Trying to get custom js files in my admin header

Ahh ok I figured it out while researching. I needed to add the $hook parameter and pass it to my function like so: function my_admin_enqueue_scripts($hook) { global $current_screen; if ( ‘post.php’ != $hook ) return; wp_register_script(‘my-scripts’, get_template_directory_uri() . ‘/js/custom/my-scripts.js’ ); wp_enqueue_script(‘my-scripts’); wp_localize_script(‘my-scripts’, ‘wp_ajax’, array( ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ))); } This gave me the results … Read more

Use WP admin AJAX url to hide API key

I would break this problem in to 2 parts. First, you could sent an Ajax request to your server, sending only the dataString variable. Then, you can use either cURL or wp_remote_get() on the server to access the real API. This could be the only solution, if you want to avoid playing hide and seek … Read more

class-wp-hook.php on line 288

Reinstalling core should fix this issue. This is more than likely related to a botched update from 5.3 to 5.3.1. Edit: To clarify, 5.3.1 included some hardening with relation to kses (specifically wp_kses_bad_protocol()) as noted in the release post. In the error output above, a core file was referencing a core function that didn’t exist, … Read more

Where can I find admin-header.php file online?

Couldn’t see a download link on the Github page for downloading single files(i don’t use it so maybe i’m just not seeing it). Alternatively you can download single files for WordPress from trac. Example: http://core.trac.wordpress.org/browser/tags/3.2.1/wp-admin/admin-header.php Scroll to the bottom of the page(or hit the End key), look for the text “Download in other formats:“ click … Read more

Alternatives to DISALLOW_FILE_EDIT wp-config Constant? It Breaks Some Plugins

I guess this would be of better use as a mu-plugin. EDIT: Now available as drop & play MU-Plugin. Also disables the »Theme« editor. <?php ! defined( ‘ABSPATH’ ) AND exit; /** Plugin Name: Disable »Theme/Plugin Editor« */ if ( ! class_exists( ‘disable_admin_editor’ ) ) { add_action( ‘plugins_loaded’, array( ‘disable_admin_editor’, ‘init’ ) ); class disable_admin_editor … Read more

Grabbing how Many Posts by Month for a Dashboard Widget

Just Went over your code and it looks fine but you are missing the code blocks for your foreach loops so: add_action(‘wp_dashboard_setup’, ‘dashboard_test’); function dashboard_test() { global $wp_meta_boxes; wp_add_dashboard_widget(‘month_dashboard’, ‘Reports Submitted for the Year’, ‘custom_test’); } function custom_test(){ global $wpdb; $years = $wpdb->get_col(“SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts WHERE post_status=”publish” AND post_type=”report” ORDER BY post_date DESC”); … Read more