ThemeShaper Forums » Thematic

[closed]

Can filter postmeta, but can't filter anything IN postmeta

(2 posts)
  • Started 13 years ago by ridgely
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. So I successfully ditched the postmeta pipe separator (hate those!) with the following:

    function childtheme_postheader_postmeta($postmeta) {
    		$postmeta = '<div class="entry-meta">';
        $postmeta .= thematic_postmeta_authorlink();
        $postmeta .= '<span class="meta-sep meta-sep-entry-date">&thinsp; &bull; &thinsp;</span>';
        $postmeta .= thematic_postmeta_entrydate();
    
        $postmeta .= thematic_postmeta_editlink();
    
        $postmeta .= "</div><!-- .entry-meta -->\n";
    		return $postmeta;
    }
    add_filter('thematic_postheader_postmeta', 'childtheme_postheader_postmeta');

    But then, I was unable to change the separator right before the editlink using this:

    function childtheme_postmeta_editlink($editlink) {
            $editlink = ' <span class="meta-sep meta-sep-edit">&thinsp; &bull; &thinsp;</span>';
    	$editlink .= '<span class="edit">';
    	$editlink .= thematic_postheader_posteditlink();
    	$editlink .='</span>';
    	return $editlink;
    }
    add_filter('thematic_postmeta_editlink', 'childtheme_postmeta_editlink');

    No errors, just nothing happened. What am I missing?

    Posted 13 years ago #
  2. if you are using the latest version of thematic you can use the override function

    // Create edit link for post meta
    if (function_exists('childtheme_override_postmeta_editlink'))  {
    	function thematic_postmeta_editlink() {
    		return childtheme_override_postmeta_editlink();
    	}
    } else {
    	function thematic_postmeta_editlink() {
    
    	    // Display edit link
    	    if (current_user_can('edit_posts')) {
    	        $editlink = ' <span class="meta-sep meta-sep-edit">|</span> ' . '<span class="edit">' . thematic_postheader_posteditlink() . '</span>';
    	        return apply_filters('thematic_post_meta_editlink', $editlink);
    	    }
    	}
    } // end postmeta_editlink

    so your override would be

    function childtheme_override_postmeta_editlink() {
    
    	    // Display edit link
    	    if (current_user_can('edit_posts')) {
    	        $editlink = ' <span class="edit">' . thematic_postheader_posteditlink() . '</span>';
    	        return apply_filters('thematic_post_meta_editlink', $editlink);
    	    }
    	}

    again, this will NOT work w/ the version that is currently in the WP repo. i'm using thematic 0.9.7.2. otherwise, i am not sure why the normal filter isn't working.

    Posted 13 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.