Tag Info

Hot answers tagged

4

If you want to do this via AJAX, on the server side you could do something like the following: add_action( 'wp_ajax_nopriv_update_shortcode_content', 'update_shortcode_content' ); function update_shortcode_content(){ if( !empty( $_GET['new_shortcode_value'] ) ){ $updated_content = do_shortcode( '[theshortcode value="' . ...


2

You should always use a full URI when specifying a location of a resource (in this case a file). With relative URIs like you use for you data file here, the URI will be appended to the URL in the address bar which will result in surprising URLs when you use permalinks. In practice the pattern for developing such thing is to upload the files via the admin ...


2

From Blackbone.js website: render is the core function that your view should override, in order to populate its element (this.el), with the appropriate HTML. The convention is for render to always return this. So, I have modified the code a little bit to add jQuery change listener. function add_gallery_type_option(){ ?> <script ...


1

My problem got solved by commenting the some codes in function.js(theme js folder) that generating "Expand child menu" text.


1

So, you're using wp_localize_script to inject the ajax url. But you didn't use the localized var handle to access that value. Try this: /* ... */ $.ajax({ url: ajaxStuff.ajaxurl, // NOTE use of 'ajaxStuff' object /* ... */


1

when ("#edit").click( is called, the element "#edit" doesn't exist so the .click( cannot be attached solution 1 you call click( juste after .innerHTML = response solution 2 use delegated event like that : $("body").on("click", "#edit", function () {...


1

There are a number of issues with your code but most importantly you need to call val on the text input. Here is how your make_year_created_equal_4_chars function might look: function make_year_created_equal_4_chars() { ?> <script type='text/javascript'> // This is a shorthand for "jQuery(document).ready()" jQuery(function($) { ...


1

It's a UNIX timestamp - with PHP, you can use date to format it like so: echo date( 'd/m/Y', $timestamp ); // day/month/year


1

Turns out it was the WooCommerce Jetpack Plugin all along. Stupid thing had something enabled which it didn't need. I guess that's what I get if I let a client access the plugin menu. Thank you, denis.stoyanov, for helping me find the solution!



Only top voted, non community-wiki answers of a minimum length are eligible