AJAX on Front-End Button Click not working – Custom Plugin

Ok, so it’s pretty easy error – just a typo πŸ˜‰ You use this line to localize your script: wp_localize_script( ‘ajax-script’, ‘my_foobar_client’, array( ‘ajax_url’ => admin_url( ‘admin-ajax.php’ ), ‘we_value’ => 1234 ) ); So you use ajax_url field to store url to admin-ajax.php But you use this line in your js file: my_foobar_client.ajaxurl, and there … Read more

AJAX button action in foreach

This is happening because you have click event firing on ID jQuery(‘#przyciskUlubione’).click(function() { The ID is always unique, there should never be more than one same ID in the HTML. You can achieve this using class. Assign the same class to all the buttons. Change your selector to class: jQuery(‘.przyciskUlubione’).click(function() { add value attribute or … Read more

How to edit the default icon of Add Media button?

this function get_stylesheet_directory_uri() return URI to current theme’s stylesheet directory and /css/my-admin.css is path to their file which you can create in your theme directory example : <link rel=”stylesheet” type=”text/css” id=”my-css” href=”https://yourdomain.com/wp-content/themes/yourtheme/css/my-admin.css”> this is the output of the code in your source

Download a file and scroll to bottom div on button click

Demo: πŸ‘‰πŸ» https://codepen.io/livehelp/pen/MWoNPqX?editors=1010 Just use an HTML or Code element in Elementor to paste in the code instead of a Button element. <h2><a href=”#smooth” onclick=”window.open(‘https://downloads.wordpress.org/plugin/apk-downloader.zip’)”;>Click to Download + Smooth Scroll</a></h2> <p>Insert enough text here to have a scoll bar.</p> <div id=”smooth”><h1>Tadaa! Jumps to this div based on the id #smooth onClick.<h1></div> <script> const links = … Read more

Adding an Archive button to posts page for administrators

Here is something i have used before as a solution for changing the post category (or any term/taxonomy) just make sure you set the right $post_type,$append,$taxonomy,$terms <?php /* Plugin Name: Simple Ajax set cat Plugin URI: http://en.bainternet.info Description: dead simple lightweight plugin to add a post row action link to set a post category by … Read more

Change the text of the publish button to Save

Put below code into your theme functions.php and try function change_publish_button( $translation, $text ) { if ( $text == ‘Publish…’ ) // Your button text $text=”Save”; return $text; } add_filter( ‘gettext’, ‘change_publish_button’, 10, 2 ); This one is worked for me Hope it will help you!

Permalink doesn’t get displayed in Twitter button (Local WordPress problem?)

After sleeping over the problem I decided to the code and tried this: <a href=”https://twitter.com/share?url=&text=<?php the_title(); ?>: <?php echo urlencode(get_permalink($post->ID)); ?> &via=username&count=horizontal” class=”custom-tweet-button”>Tweet</a> All I can say is: it works as it should be. Next thing on my agenda is to incorporate a custom url shortener. PS: It’s worth a mention that if you use … Read more