Add custom button to the changeset status in the Customizer

Unfortunately there is no official hook for customizer actions yet. Since the customizer actions are predefined by javascript, you can use the The Customizer JavaScript API to add new actions via the push function. PHP function for the index.php/functions.php: // Include scripts in customizer. add_action( ‘customize_controls_enqueue_scripts’, ‘script’ ); function script() { wp_enqueue_script( ‘custom-customize-controls’, plugin_dir_url( __FILE__ … Read more

Customize all image captions

Depending on whether the captions are using the same CSS class or HTML tag, you can add a :before pseudo element to the CSS. This will add an image before every <caption> tag on your website. caption:before { content: ”; display: inline-block; background: url(‘your-image-url-here’); background-repeat: no-repeat; background-size: contain; background-position: center center; height: 15px; width: 15px; … Read more

Why does customize_register only load inside of functions.php for me?

In the second version you’re running your code as a wp_enqueue_scripts hook. This is for frontend scripts and isn’t called in the admin site. For that you need to hook admin_enqueue_scripts as well: add_action( ‘wp_enqueue_scripts’, ‘boatTheBusForOutdoorAccess_register_url’); add_action( ‘admin_enqueue_scripts’, ‘boatTheBusForOutdoorAccess_register_url’); That said, it might be simpler to just include your admin scripts based on is_admin() if … Read more

tech