Use Media Uploader on Multiple Images on same page

So I set a new variable of target_input that grabs the previous input field ID, this input is where I want the URL of the selected media stored, this is done in the click function of the button that selects the media. That variable is used to attach the URL. jQuery(document).ready(function($){ var custom_uploader; var target_input; … Read more

Notepad sticky plugin

You need to create separate tables for store sticky notes and save user sticky notes to that tables , in this way you can manage multiple sticky notes of user. i think this idea will help you.

Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control

If the setting and controls are added exactly as they appear in class-wp-customize-manager.php the JQuery script in wp-admin/custom-header.php will toggle the header text color control properly. The theme_supports line must be commented out or removed as it is “used to hide a setting if the theme lacks support for a specific feature”.[1] add_action( ‘customize_register’, function … Read more

My javascript jquery won’t work?

Try loading your script in the footer: wp_enqueue_script( ‘test’, get_template_directory_uri() . ‘/js/testJS.js’, array(‘jquery’), false, true );` The true parameter on the end tells WordPress to load this script in the footer instead of the header. For more information, visit the Codex: https://developer.wordpress.org/reference/functions/wp_enqueue_script/

Reorder displayed posts with JQuery (title A-Z / last posted)

With WordPress you can utilise a function called wp_localize_script() which allows you to pass in a script, and a variable you would like that script to have access too. Perhaps by assigning the new query to a variable, and then accessing it within jQuery would help you solve your problem. The example provided by WordPress … Read more

Getting all URLs of uploaded images using media uploader

Got it working with a code from this question https://stackoverflow.com/questions/14847668/get-url-of-freshly-uploaded-image-from-wp3-5-media-uploader Maybe somebody will find it useful. This code logs URL of every freshly uplaoded image to console. jQuery(document).ready(function($){ $(‘#upload-btn’).click(function(e) { e.preventDefault(); var image = wp.media({ title: ‘Nahranie obsahu’, // mutiple: true if you want to upload multiple files at once multiple: true }).open() .on(‘select’, function(e){ … Read more