Popup Maker nav menu item not working

You can use something like this, add_filter( ‘wp_nav_menu_items’, ‘your_custom_menu_item’, 10, 2 ); function your_custom_menu_item ( $items, $args ) { if ( $args->theme_location == ‘Primary’ ) { // change the menu location if not Primary $items .= ‘<a class=”request-maintenance-open” href=”#contact_form_pop”>Request Maintenance</a>’; } return $items; }

How to avoid redefining requirejs in plugin when another plugin also uses requirejs

You could take a look at the enqueued scripts in $wp_scripts ($wp_scripts->registered), but the naming could be different (“it’s requirejs but let’s call it loadstuffjs, just because”), so I doubt it’ll be close to perfect. Also, your plugin might be loaded before the other plugin, and they might trigger the problem without you having any … Read more

How can I use a video header that’s over 8MB?

The limit is enforced by _validate_header_video method, registered as validation callback on respective Customizer setting. There is a filter that allows you to hook into the process and manipulate those arguments: add_filter( ‘customize_dynamic_setting_args’, function ( $args, $id ) { if ( ‘header_video’ === $id ) { // change $args[‘validate_callback’] } return $args; }, 10, 2 … Read more

From where come that JS files in ?

Quick but not recommended solution – remove wp_head() function from your header.php file. NOT RECOMMENDED, because new plugins may not work once you did this. The best way is to find that files in you theme code, just perform a search within your theme files for wp_enqueue_script – you have to find the hook where … Read more

What is the purpose of the wp_enqueue_script() handle?

Below is an example of the jquery handle being used in various ways: // add my js, written in jQuery // so it requires `jquery.min.js` to be output first // & say I do this in a early hook like `init` wp_enqueue_script( ‘my-js’, ‘js.js’, array(‘jquery’)); // later in theme: // remove WordPress’s default jquery, // … Read more

Correct way to use register_activation_hook

This quotation from The Codex clearly states what does this function do: The register_activation_hook function registers a plugin function to be run when the plugin is activated. This means, this function works similar as a class’s __construct() method. You can use it to set initial options, update database, and more. It doesn’t run every time … Read more

How to get CMB2 to show a single image at a specific size

You can get ID of the attachment, and then use that to get whichever size you need. https://github.com/CMB2/CMB2/wiki/Field-Types#file A file uploader. By default it will store the file url and allow either attachments or URLs. This field type will also store the attachment ID (useful for getting different image sizes). It will store it in … Read more