ThemeShaper Forums » Thematic

[closed]

childtheme_override_postfooter_postconnect()

(7 posts)
  • Started 2 years ago by umberto
  • Latest reply from umberto
  • This topic is resolved
  1. umberto
    Member

    Hi - I'm trying to get this override to work. Just wanting the edit link, but code below seems to remove everything including the link.

    function childtheme_override_postfooter_postconnect() {
    	    if (current_user_can('edit_posts')) {
    	        $postconnect .= ' ' . thematic_postfooter_posteditlink();
    	    }
    	}

    Appreciate any tips

    Posted 2 years ago #
  2. try removing the period just before the equal sign

    $postconnect = ' ' . thematic_postfooter_posteditlink();

    typically that means 'add this to the end' but you usually have to start w/ a simple =

    Posted 2 years ago #
  3. umberto
    Member

    Thanks Helga - had tried that with no change.

    On a hunch I added the apply filters line and it actually worked (with or without the period) which was unexpected as I was under the impression that this wasn't necessary with an override:

    function childtheme_override_postfooter_postconnect() {// Display edit link on single posts
    	    if (current_user_can('edit_posts')) {
    	        $postconnect .= ' ' . thematic_postfooter_posteditlink();
    	    }
    	    	    return apply_filters('thematic_postfooter_postconnect',$postconnect);
    	}

    Is that standard procedure or is something amiss elsewhere?

    Posted 2 years ago #
  4. hmmm... could be one that got missed. not sure if that is correct or not.

    Posted 2 years ago #
  5. kwight
    Member

    I think the part you're missing in the first example is the "return", to actually get your variable out of the function. I can't test it at the moment, but if all you want is the Edit link, this should work too:

    function childtheme_override_postfooter_postconnect() {
        if (current_user_can('edit_posts')) {
            thematic_postfooter_posteditlink();
        }
    }
    Posted 2 years ago #
  6. good point kwight. you have to return something or echo something, though i think returning is better here b/c the postfooter_postconnect is echoed out by a different function... thematic_postfooter

    function childtheme_override_postfooter_postconnect() {// Display edit link on single posts
    	    if (current_user_can('edit_posts')) {
    	        $postconnect = ' ' . thematic_postfooter_posteditlink();
    	    }
    	    	    return $postconnect;
    	}

    should work?

    Posted 2 years ago #
  7. umberto
    Member

    Yes, that works Helga. Great stuff. Thank you both for your help.

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.