• Resolved andrewbirmingham

    (@andrewbirmingham)


    for the life of me i can not hook into this supposedly available action.

    <?php

    add_action( ‘permalink_structure_changed’, ‘my_custom_function’ );

    function my_custom_function()
    {
    echo ‘<script>alert();</script>’;
    }

    ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • Stef

    (@serafinnyc)

    Make sure your not leaving the <?php and the close in there. There’s already one in your functions file. But that’s not even how you change the structure.

    • This reply was modified 7 years ago by Stef.
    Moderator bcworkz

    (@bcworkz)

    Verifying a hook fires by setting an alert box is unreliable in PHP because the browser is not always expecting output when actions fire. In such cases the output is ignored. Try using error_log() to send debug messages to the log file.

    Thread Starter andrewbirmingham

    (@andrewbirmingham)

    @stef

    this was just simple plugin i created to test only the hook. it’s not within my other php anywhere. sorry for confusion.

    @bcworkz
    thanks for the input going to try this out now.

    it worked. really appreciate the feedback. been a long few weeks late night. my mind is starting to get discombobulated

    Stef

    (@serafinnyc)

    No worries. All good.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘permalink_structure_changed action hook’ is closed to new replies.