New answers tagged

1

That area of all admin screens is where admin notices are displayed, so you could generate an admin notice. Here's a suitable function and hook: function wpse_233031_admin_notice() { ?> <div class="notice notice-info"> <p>Your message here!</p> </div> <?php } add_action( 'load-upload.php', ...


0

You could take a cautious approach in your hooked functions and test whether you are on the front end or admin of the site. You could search the latest WP source for the hook you are using and see where it will have an impact.


0

You can use the _core_updated_successfully action hook to run your plugin code after the WordPress core upgrade. The hook passes the current WordPress Version as parameter. add_action( '_core_updated_successfully','your_function'); function your_function(){ //code to be executed after WordPress Core Update }


0

You will find the Codex Action Reference handy - while it doesn't list everything, it gives a good overview of action order which can help locate the correct action if the one you're using runs too late. In your case, wp does indeed run after the query is run, but looking at that list it appears - depending exactly on what logic you're wanting to run - that ...


1

I have been looking around the core files searching for hooks, there were very few when it comes to hooking into edit_user() function which updates the user data in profile.php page, so I have finished with some workarounds: My workaround is to save the user's password in a custom option before the password was updated, and match later with this user's ...


0

You can use the native PHP sleep() function in WordPress for timers in seconds, or usleep() for timers in microseconds: http://php.net/manual/en/function.sleep.php http://php.net/manual/en/function.usleep.php


0

genesis_after_post_title is an action hook for legacy loops(XHTML themes) and is deprecated since Genesis v1.7.0. In HTML5 supported themes you can hook to genesis_entry_header. add_action( 'genesis_entry_header', 'genesis_do_breadcrumbs' );


0

Sadly there are no hooks or filters that you could use in edit-comments.php. You'd have to build your own admin page with a custom button and use wp_set_comment_status( $comment, 'approve' ); to approve comment and do whatever you need to do... EDIT: I was wrong - there's the wp_set_comment_status action inside wp_set_comment_status function https://wpseek....


2

There's a filter for the output $job_listings_output = apply_filters( 'job_manager_job_listings_output', ob_get_clean() ); so, you should just do add_filter('job_manager_job_listings_output','my_job_manager_job_listings_output'); function my_job_manager_job_listings_output($output) { $adsense_code = ' My adsense code'; return $output . $...


1

It looks like you are trying to access the $lava_listing_posts_args array from a different file (and class). You would need to pass it as an argument of your action. Although you could do this with actions since you are simply modifying the array you should probably use filters (actions and filters are essentially the same thing, just used differently) ...


0

Please follow the code: add_action( 'wp_ajax_add_myfunc', 'prefix_ajax_add_myfunc' ); add_action( 'wp_ajax_nopriv_add_myfunc', 'prefix_ajax_add_myfunc' ); function prefix_ajax_add_myfunc() { // Handle request then generate response using WP_Ajax_Response } and in your ajax call do this: jQuery.post( ajaxurl, { 'action': 'add_myfunc',...


0

I found this. /** * @snippet Disable Link to Products @ Loop * @how-to Watch tutorial @ http://businessbloomer.com/?p=19055 * @sourcecode http://businessbloomer.com/?p=19916 * @author Rodolfo Melogli * @testedwith WooCommerce 2.5.2 */ // Close </a> tag just after it opens before product item add_action( '...


0

I don't know any other way There is a much, much better way to do this - custom fields. As per these instructions in the custom fields docs, let's say you use the field name iframe_url: <iframe src="<?php echo esc_url( get_post_meta( $post->ID, 'iframe_url', true ) ?>" width="960" height="540" frameborder="0" allowfullscreen="...


5

It is not a bug. As @LuisSanz pointed out, post_type_link isn't used for the built-in post post type. It is used for custom post types only. Skim through get_permalink() function, you will find out that WordPress doesn't use post_type_link filter but uses post_link filter. It means that you're using wrong filter. Then, change post_type_link to post_link ...



Top 50 recent answers are included