wp_enqueue_script( 'main', plugins_url( '/main.js' , __FILE__ ),array("jquery","player"),'0.0.3',true);
wp_enqueue_script( 'main', plugins_url( '/main.js' , __FILE__ ), ["jquery"] );
Also avoid to ...
What you are referring to is typically a combination of ajax and pushState. It's a nifty effect and can add value to the end-user experience.
I deployed it on a WordPress site I built a few years ago (take a look here).
You can see an ...
Service worker only cache origin file, so You dont need to precache cross origin file such as https://fonts.googleapis.com
Or you can try from here https://developers.google.com/web/updates/2016/09/foreign-fetch
So the issue has already been resolved via the comments and the current state of the question already includes the corrected code. But I thought I should post this answer as a reminder for you, me and everyone reading this. :)
So first off, here's a helpful excerpt from an article on WP Engine:
The “unexpected end of file” error is not specific to ...
Those two scripts are not PHP and should not be inside of functions.php
Instead try placing those scripts inside of header.php or inside of your theme's Header Code area.
Then the second script you posted should also be added inside of header.php or inside of the theme's Header Code area.
Please note that since we do not know which image, class or HTML you ...
Mostly no, but you shouldn't do that anyway.
The exception, is if your user has the unfiltered_html capability, which is a dangerous power to have. Users that have this are admins on a single site install, or a super admin on a multisite install.
But, there are major security downside to putting script and style tags directly into articles.
For CSS, it's ...
In your functions.php file (you're using a custom child theme, right?) change/add the version parameter to wp_get_theme()->get( 'Version' ) this will pull the version number from your theme's style.css file.
Setting this parameter to false will use the WordPress version.
It's using 5.2.3 because no version was specified when style.css was enqueued/registered. So it fell back to the version of WordPress.
If you pass in a version when calling wp_enqueue_style, it will use that value instead
You're using the incorrect hook. The only hook is wp_enqueue_scripts (plural). You use wp_enqueue_style() and wp_register_script() etc. on that hook, but the hook is always the same.
add_action('wp_enqueue_script' , array( $this, 'initBootstrap' ));
add_action('wp_enqueue_style' , array( $this, 'initBootstrap' ));
add_action('wp_register_script' , ...
It is possible that your caching plugins are preventing the script from loading.
Your site may also be http and not https, hence the reason why https script cannot load. Try changing the script to http:
You're using get_next_post and get_previous_post correctly with get_permalink. The next and prev functions either return a WP_Post object or a falsy value. The permalink function accepts either a post object or a valid post ID and returns the post url as string, if it was found, otherwise it returns boolean false.
I tested the code you've posted by copy-...
What you want to do is relatively easy, if you are familiar with Wordpress Theme modifications. The following will assume you are at least comfortable with PHP, and hopefully Wordpress Theme modification. If not, I can provide some additional links in subsequent updates to this answer ... just let me know.
First step: Gravity Forms documentation has ...
The nonce authentication method is only for requests made from within WordPress, as described in your own link (emphasis mine):
It is important to keep in mind that this authentication method relies
on WordPress cookies. As a result this method is only applicable
when the REST API is used inside of WordPress and the current user is
logged in. In ...
You can't send the data to admin-ajax.php as JSON:
For the wp_ajax_ actions to be fired, WordPress checks $_REQUEST['action'], but this is not populated by PHP when the form is submitted as JSON. The correct way to send the request with jQuery is to pass the data like this:
We can indeed conditionally load CSS and JS files via shortcode conditionally, when the shortcode is present and without using any overly elaborate functions:
Refer to comment #348349 here: Enqueue Scripts / Styles when shortcode is present
This solution didn't exist at the time this question was asked, but since I was led here in my quest to find an answer, I figure it might help someone else.
I'm not sure how to capture the upload event as I'm using CMB2's event cmb_media_modal_select, but setting the featured image is as simple as:
More on this portion of ...