WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Update in the documentation of Changing Action Links

[Resolved] Update in the documentation of Changing Action Links

  • Daedalon
    Participant

    @daedalon

    Changing Action Links

    The example needs a ; in the end of the following line in order not to break the site immediately upon activation:

    $url = 'YOUR REGISTRATION URL HERE'

    For a second improvement, the documentation could change that this only changes where the action links point to, and that to have there be a proper page where the new link points to something else needs to be done, and a link to that documentation (which I’m trying to find :)).

    For a third improvement, I’d make the example use curly braces “{}” with the if. The WordPress coding standards don’t insist on this, but many others do due to the amount of time wasted on hunting bugs that were caused by editing code that didn’t originally contain these. Even experts fall for that sometimes, and the people using copy-paste solutions from the documentation are mainly not experts, so two curly braces in a copy-paste can save a lot of headache around the world.

    http://wordpress.org/extend/plugins/theme-my-login/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jeff Farthing
    Participant

    @jfarthing84

    I’ve added the missing semi-colon. Thanks for pointing that out.

    somebodyElse
    Member

    @jjcsforwood

    Where in the world do you put the tml_action_url filter?

    bobibrown0
    Member

    @bobibrown0

    I’d like to know this too, where do you add the tml_action_url filter ?
    I put it in the function.php of my theme, but not working.

    Plugin Author Jeff Farthing
    Participant

    @jfarthing84

    There’s no reason it shouldn’t work in your theme’s functions.php file.

    bobibrown0
    Member

    @bobibrown0

    okay, for example I don’t want the user to be able to see the wordpress dashboard.

    So I tried:

    function tml_action_url( $url, $action, $instance ) {
    	if ( 'profile' == $action )
    		$url = 'http://mywebsite.com/customdashboard/';
    	return $url;
    }
    add_filter( 'tml_action_url', 'tml_action_url', 10, 3 );

    And yes I added this to the very bottom of my function.php file. I guess I did a mistake then?

    Plugin Author Jeff Farthing
    Participant

    @jfarthing84

    That function simply changes the output of the profile link.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] Update in the documentation of Changing Action Links’ is closed to new replies.