‘Conflict’ with action deleted_post and is_admin()

More importantly you should notice what link is produced by get_delete_post_link(). It’s an admin link is_admin() check will be always true. Instead you need something else that helps match the request. Try adding and query arg to your delete link. add_query_arg( ‘origin’, ‘fe’, get_delete_post_link( get_the_ID() ) ); then in the action add_action(‘deleted_post’, ‘woffice_trashed_post_handler’, 10); function … Read more

I can’t enqueue Suggest.js in frontend – not added

Provided you’ve confirmed that WP’s native ‘suggest’ script is actually being rendered on the page properly (ie. you’re using the correct template for home vs front-page), sometimes to avoid script conflicts on the page, you need to wrap your script in an anonymous function. So something like: <script> (function($) { $(“#my_input”).suggest(“<?php echo get_bloginfo(‘wpurl’); ?>/wp-admin/admin-ajax.php?action=ajax-tag-search&tax=my_taxonomy”, { … Read more

previous_post_link inside of a function?

previous_post_link() and next_post_link() should work inside the the_content filter. There is nothing wrong with your code except you must return the value inside the filter instead of print. Otherwise I believe post link should be there at the beginning of content. previous_post_link() and next_post_link() print the output so consider using get_previous_post_link() and get_next_post_link(). function prevnext( … Read more

Pass arguments to function class with do_action()

If you want to apply the add_action and do_action in combination with class object, you have to use a static function to access your class. Try this code with your own wording/variables: class My_Plugin { protected static $_instance = null; // Static function used to access this class public static function get_instance() { if ( … Read more