How to log custom plugin error to debug.log file
U need to also define WP_DEBUG as true // Enable WP_DEBUG mode define(‘WP_DEBUG’, true); // Enable Debug logging to the /wp-content/debug.log file define(‘WP_DEBUG_LOG’, true); It will may help you.
U need to also define WP_DEBUG as true // Enable WP_DEBUG mode define(‘WP_DEBUG’, true); // Enable Debug logging to the /wp-content/debug.log file define(‘WP_DEBUG_LOG’, true); It will may help you.
If you want to replace the theme home page, you cannot use wp_head hook: it is called from a theme file (usually header.php) so you can’t replace something that is already included. I suggest you to create a php file that contain your custom home page, and put it in a plugin folder. This file, … Read more
I don’t understand if it works for you or not. For me the code is not wrong, maybe can be optimized. For the ajax request, if it is made in the backend, yo do not need to pass the ajax url using wp_localize_script. From WP 2.8 a global variable ajaxurl is defined to be used … Read more
G.M.’s advice not withstanding, bear in mind that there is no foolproof way of isolating your table from the theme. CSS selectors with more specificity, or with rules that you haven’t accounted for, or with !important rules, will always take precedence. This is actually correct behaviour, as websites should be able to style elements (including … Read more
An alternative way to add admin scripts/styles only on your plugin’s page: //The add_action to add onto the WordPress menu. add_action(‘admin_menu’, ‘myplugin_custom_menu_page’); function myplugin_custom_menu_page() { $GLOBALS[‘my_plugin_page’] = add_menu_page( ‘My Plugin’, ‘My Plugin’, ‘manage_options’, ‘myplugin/myplugin-admin.php’, ”, plugins_url( ‘myplugin/images/icon.png’ ), 33 ); } add_action( ‘admin_enqueue_scripts’, ‘my_enqueue_scripts’ ); function my_enqueue_scripts($hook_suffix) { if( $GLOBALS[‘my_plugin_page’] == $hook_suffix ) { wp_enqueue_style( … Read more
Maybe I am missing the point but assuming that a script is enqueued with the lu_ban slug… function add_data_admin_wpse_112178() { $data = get_option(‘lu_ban_data’); wp_localize_script( ‘lu_ban’, ‘lu_ban_object’, $data); } add_action(‘admin_enqueue_scripts’,’add_data_admin_wpse_112178′);
I’ve installed your plugin and it doesn’t work. Feeds counter are updated correctly, but no feed are shown (and so no ‘Press this’ buttons). After that when I install it I see several notices: are you testing your plugin with wp debugging active? The best way, for me, is redirect users to the standard wordpress … Read more
In $control_ops = array( ‘width’ => 300, ‘height’ => 350, ‘id_base’ => ‘example-widget’ ); id_base should be without space and in your rollover image, your name is wrong, you have the name set to echo $this->get_field_name( ‘image’ ); when it should be echo $this->get_field_name( ‘rollover_image’ ); add_action ( ‘widgets_init’ , ‘my_widget’ ) ; function my_widget … Read more
Try this: // Wrap <li> tags around each template item. add_filter( ‘child-pages-shortcode-template’, ‘wpse_113253_child_pages_shortcode_template’ ); // Wrap <div> and <ul> tags around everything. add_filter( ‘child-pages-shortcode-output’, ‘wpse_113253_child_pages_shortcode_output’ ); /** * Wrap <li> tags around each template item. */ function wpse_113253_child_pages_shortcode_template( $template ) { return “<li>$template</li>\n”; } /** * Wrap a <div> and <ul> tags around everything. */ … Read more
Whatever is hooked to activation runs in just a single request when the plugin is activated in a sandbox, and the output is captured to check for errors. Your code won’t run on any subsequent request after that single activation, so your script will not be registered. It works on init because that action runs … Read more