RSS Feed Custom Title?

Edited: Bad answer removed. Here is the working code: function custom_blogname_rss($val, $show) { if( ‘name’ == $show ) $out=”Custom Blog Name”; else $out = $val; return $out; } add_filter(‘bloginfo_rss’,’custom_blogname_rss’, 10, 2); Don’t forget to change Custom Blog Name to something useful. Put that code into a plugin.

admin_notices after register_uninstall / deactivate_hook

The short answer is no, it is not possible. When you deactivate your plugin, it’s deactivated so doesn’t run your admin_notices action when the admin screen is refreshed. You can confirm it for yourself by using the action in a slightly different way. In your deactivation function include the following line: set_transient(‘my_deactivation_transient’, ‘My plugin is … Read more

Generating robots.txt dynamically

I just tested the ‘robots_txt’ filter on a single installation to modify the output of the virtual /robots.txt that WordPress displays and it worked fine for me: add_filter(‘robots_txt’, ‘wpse_248124_robots_txt’, 10, 2); function wpse_248124_robots_txt($output, $public) { return ‘YOUR DESIRED OUTPUT’; } What is really happening when you try to reach /robots.txt? Does it display the default … Read more

Post-Registration, post-meta hook?

You can use user_register add_action(‘user_register’, ‘wpse42506_user_register’, 10, 3); function wpse42506_user_register( $user_ID ) { // do stuff here } If you want to just use the user information, you can use get_userdata http://codex.wordpress.org/Function_Reference/get_userdata If you need more control, you can initiate a new WP_User http://codex.wordpress.org/Class_Reference/WP_User

deactivated_plugin hook: get the name of the plugin

You can hook into the action ‘deactivate_plugin’ to get the plugin’s base name and (as second parameter) if it was deactivated network wide. See wp-admin/includes/plugin.php function deactivate_plugins(). There seems to be no hook for plugin deletion. Sample logging code: add_action( ‘activated_plugin’, ‘t5_plugin_logger’, 10, 2 ); add_action( ‘deactivated_plugin’, ‘t5_plugin_logger’, 10, 2 ); /** * Log plugin … Read more

How can I hook into the post editor title field in order to change the HTML?

There is no hook to change the HTML of the input (only the enter_title_here filter to change the placeholder text). You could pull this off easily with jQuery, though. Try this in your functionality plugin or theme’s functions.php file: // Add to the new post screen for any post type add_action( ‘admin_footer-post-new.php’, ‘wpse_add_required_attr_to_title_field’ ); // … Read more

Check if action hook exists before adding actions to it

You cannot check if an action will be called before that happens. Even if there were already callbacks attached to the action there would be no guarantee the matching do_action() will be used. In your case, test with is_plugin_active(): if ( is_plugin_active( ‘wordpress-seo/wp-seo.php’ ) ) { // do something } As @Barry Carlyon mentions in … Read more

admin_post hook not called

Modify your form to include: <form action=”<?php echo admin_url(‘admin-post.php’); ?>” method=”post”> <input type=”hidden” name=”action” value=”volunteer”> … </form> and add an action to run your function: add_action( ‘admin_post_volunteer’, ‘send_contact_to_civicrm’ ); add_action( ‘admin_post_nopriv_volunteer’, ‘send_contact_to_civicrm’ ); function send_contact_to_civicrm() { // stuff here }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)