WordPress ajax error 400 bad request for sending data to remote site [duplicate]

Your action name and hooks don’t match. You have hooked to _ajax_news in the hook name: add_action( ‘wp_ajax_nopriv_ajax_news’, ‘ajax_news’ ); add_action( ‘wp_ajax_ajax_news’, ‘ajax_news’ ); But the action you are sending in JavaScript is ajaxnews, without the underscore: ‘action’: ‘ajaxnews’, //calls wp_ajax_nopriv_ajaxnews See how your own comment has a different name than the actual hooks you’ve … Read more

Add WordPress Meta Box saved form input to WordPress RSS feed [duplicate]

I figured out the code to add to the above tutorial article about creating a Meta Box that saves values. This code puts the post meta into its own tag in the RSS. I added the post meta “meta-text” to the code below to work with the tutorial. add_action(‘rss2_item’, ‘add_my_custom_field_node’); function add_my_custom_field_node() { global $post; … Read more

The plugin generated 225 characters of unexpected output during activation

I solved this issue. Problem was in way I was using register_activation_hook. I loaded TbybInstall along with other classes: /* * Load classes */ require plugin_dir_path( __FILE__ ) . ‘classes/class.PreparedCarts.php’; require plugin_dir_path( __FILE__ ) . ‘classes/class.ReturnOptions.php’; require plugin_dir_path( __FILE__ ) . ‘classes/class.TbybInstall.php’; …and I used register_activation_hook in a way which is more similar to official … Read more

Buddy Press restrict the capability to edit users

Ok I got an solution for my case. Maybe a bit confusing but I did’nt saw anothere possibility to do this. If you know a better way let me know. First I hide the Edit Item in the Admin Menu: add_action( ‘admin_bar_menu’, array($this,’sa_classbook_remove_admin_bar_items’), 999 ); function sa_classbook_remove_admin_bar_items(){ global $wp_admin_bar; $wp_admin_bar->remove_node(‘user-admin’); } Then I check the … Read more