Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [javascript]

A client side scripting language useful for making interactive web sites. Questions about using JavaScript outside a WordPress context are off-topic but might be asked on Stack Overflow.

0
votes
0answers
8 views

generate notification on name of my own plugin in istalled plugin area [on hold]

Hey i am new in developing and i want to generate notification on "deactivate option" of my own plugin on admin page can someone help me.plzzz
-1
votes
1answer
14 views

Blog page stopped working [on hold]

My friend's blog page ourwildlife.studio/blog has stopped displaying the posts. I got a feeling it has something to do with the JavaScript but I am at a loss here.
0
votes
0answers
26 views

Avoiding compatibility issues with JavaScript libraries in WP plugins

Having a look at https://developer.wordpress.org/themes/basics/including-css-javascript/#default-scripts-included-and-registered-by-wordpress I see that some JS libraries are included with WordPress. ...
0
votes
1answer
19 views

wp.editor.initialize does nothing

I'm trying to add additional wp_editor instances when a user clicks an "Add content" button in the back-end. I have it mostly working, except that the user needs to save the post after adding the ...
0
votes
0answers
26 views

Uncaught SyntaxError: missing ) after argument list

I'm getting this error when loading my page. I have 5.0.3 of WordPress. Uncaught SyntaxError: missing ) after argument list :formatted:1845 The link redirect to this code: <script type='...
0
votes
0answers
7 views

How to duplicate form div elements? [migrated]

This code is not working when I am trying to duplicate form elements or DIV.But the code is working when removing form tag.I want to be able to duplicate Div under form Tag using plain javascript. ...
0
votes
1answer
20 views

Masonry grid with bootstrap 4

I have the following code that is supposed to display a masonry grid using bootstrap 4. I've tested the code but the grid will not be displayed correctly on desktop and tablets. On mobile instead ...
0
votes
1answer
62 views

How to get current_user_id from wordpress in node js?

There is a website on wordpress, in the plugins folder I have a project on Node js. In index.html (the client part, mostly js there), there is content that I have to show only to registered users. I ...
0
votes
2answers
19 views

Removing auto versioning of JS and loading to header

I want to remove the JS I added and gets versioned by wp. I have a js script called base.js, and wordpress loads that by itself like <script type="text/javascript" src="../base.js?ver=4.9.9">&...
0
votes
1answer
22 views

Javascript only works if browser Developer Tools panel is open

Working on getting a Font Awesome icon to CSS animate upon entry into the viewport on scroll. Behaves as expected only when the Developer Tools panel is open in various browsers on Mac: Chrome, Safari,...
0
votes
1answer
20 views

wp_mail doesn't work when logged in?

I am having trouble with a wp_mail function I created, which sends an email when I press a button. It does work great when you do this logged out. But as soon as I am logged in it stops working. It is ...
0
votes
1answer
36 views

what is the purpose of the namespace argument when customizing blocks?

I'm trying to customize the Gallery block using the new Gutenberk Block API thing. Long story short, I need to add a filter to do the customization. So what is the purpose of the namespace argument ...
0
votes
1answer
26 views

Javascript error when adding an item to the cart [on hold]

I have been trying to figure this issue out for hours and would really appreciate the help anyone can give. Do you have any idea how I can fix the Javascript error on this page that prevent adding ...
0
votes
2answers
19 views

Bad Request when adding new post via ajax form

I am trying to insert a new post with a simple ajax form in a wordpress plugin. Visitors will use this form to create posts from frontend. My form is like this: <script> jQuery( document )....
0
votes
0answers
10 views

Gravity Forms Conditional Pricing w/Dynamic Field Population? [on hold]

I have setup an event registration form which is dynamically populated with event info via the shortcode for the form. Works great. We offer earlybird pricing for some of our events, but the ...
1
vote
0answers
20 views

Extending wp JavaScript base class to make a post request to a custom REST endpoint

I've defined a REST endpoint /my-plugin/v1/post-read to show whether a post has been read or not, per-user. In PHP, my plugin keeps track of this depending on page views while logged in. I'm now ...
-1
votes
2answers
24 views

How to target a notice for a specific browser [on hold]

I have seen that Opera Mini is the second browser in traffic numbers to my blog. However, Opera Mini disables javascript by default on install which makes my website elements look out of place. I ...
1
vote
0answers
51 views

What are all the query parameters for getEntityRecords?

I'm working on a plugin that defined a custom block for the Gutenberg/Block Editor. The block shows a select box of posts. When you select one, I create HTML with some of the selected post's fields, ...
0
votes
0answers
7 views

Detect after “attachment details pane” is shown so that I can manipulate its html content in WP 4.9.9 default media modal

I'm looking for a way, in Javascript, to write my callback to perform some operations on the HTML of the right sidebar area in the media editor, specifically the "ATTACHMENT DETAILS" plus the "...
0
votes
0answers
17 views

Unfixable post page in Wordpress

I'm using a wordpress package and a free official theme of its database on my website. After trying to minify my js and css codes a problem just occured and that was unfixing the content bar on mobile ...
0
votes
1answer
11 views

Hide Load more Ajax button if there is no more users to load or less than the number?

How to hide the Load more Ajax button if there is no more users to load or less than the number <script type="text/javascript"> var ajaxurl = "<?php echo admin_url( 'admin-ajax.php' ); ?>"...
0
votes
1answer
43 views

Make a list with header and subtext in Gutenberg blocks

I want to create a block in the gutenberg editor, to create lists with a header and subtext (interview format with question and answer). The list should be in an ordered list. I can't figure out how ...
2
votes
1answer
48 views

Adding a text element in between title and blocks container

Is it possible to add an additional text input before the Blocks editor? I'm trying to update my Subtitle plugin to be Gutenberg compatible, but the subtitle isn't really a "Block" and I think it's ...
0
votes
0answers
20 views

Replace the WordPress Media Library Uploader

I would like to replace the WordPress Media Library Uploader within the admin section to use Filepond. Server Documentation is here plugin.php add_action( 'wp_enqueue_scripts', function() { // ...
0
votes
0answers
13 views

Update checkbox value from clicking button

I have a CPT and in the columns section, there is a button. I have a checkbox in my custom meta box and it is hidden. But when the checkbox has been clicked the text of the button and color will be ...
0
votes
0answers
13 views

create to search column

i m create to custom post type shortcode but at the last i m trying to add Individual column searching in my table but i can't access.. this is my post_type_shortcode.php <?php function ...
3
votes
0answers
28 views

Hooking a callback into the code within a Gutenberg block

I want to run some JavaScript when a user uploads an image or images using the core/image block or core/gallery block. Ideally I would run my own code when the onSelectImage function is called (and ...
0
votes
0answers
38 views

wp_editor not working in external file

I am pulling info from my Wordpress database into a dropdown. When an option is selected from the dropdown, a div is populated with a form from another page. The page gets the info from the database ...
0
votes
1answer
63 views

How to render WP Rest-API Endpoints in a React.js Theme with Woocommerce

I am building a Ecommerce Wordpress/Woocommerce Theme using React.js. I am using the npm package: create-react-wptheme This package renders the react app directly inside of the index.php of the ...
0
votes
1answer
75 views

Web Developer Console: “Slow network is detected.” with fonts

I am new to coding and just started working on a website. The issue that I am having is the extreme lag time. The site that I am using is in wordpress with a custom theme. Every plugin has been ...
4
votes
1answer
74 views

Set default image link target in Gutenberg image block

I want to set the default target of the image block in Gutenberg to "Media File": I've found solutions for the classic editor, and one that appears to work for Gutenberg galleries by editing the ...
0
votes
1answer
19 views

wordpress dependent dropdownlist using post type is not working

wordpress dependent drop down list using post type is not working in ajax. I need a ddl value from another ddl in post type. i have 2 post type department and doctors, when i select a department in ...
0
votes
1answer
24 views

What's the best way to format ACF number fields for display on the front end?

I hired someone to help with this, and he had a javascript solution which he entered in the theme footer. I just added an html tag and it worked. However, it broke because he didn't use the child ...
0
votes
1answer
22 views

Show and hide element when URL contains certain section of text?

I require #nav1 to display and #nav2 to hide on all pages which include "/category-1/" in the URL. I require #nav2 to display and #nav1 to hide on all pages which include "/category-2/" in the URL. ...
0
votes
2answers
28 views

Performance vs plugin genrated javascript

First off let me explain what I mean. I work on a company that got a WP page with a theme installed and a load of plugins, like YOAST, WooCommerce, more plugins for woo commerce etc etc. Those plugins ...
0
votes
1answer
29 views

How to read inline-CSS from Gutenberg block?

I'm building a simple Gutenberg block. Attributes attributes: { sign: { type: 'string', source: 'text', default: '+' }, size: { ...
0
votes
0answers
15 views

DIV isn't loading content from AJAX on my WordPress

I have a WordPress that I am setting up. The design calls for a list of titles, and when you click on the title, the post's content slides in from the right. I want to load the div with the post ...
0
votes
1answer
29 views

wp_dropdown_categories not showing option as selected

I'm using the below code to list categories as hierarchical. On change of select options it is redirecting to the respective category pages. But it not showing the category as selected.Could any one ...
0
votes
0answers
17 views

WordPress Media Library: Custom tab content displayed in “Media Library” tab

I write a WordPress plugin that is adding a custom tab in the Media Library. Problem is that sometimes when I open wp.media.frame content from custom tab is displayed inside of Media Library tab. ...
1
vote
1answer
20 views

VB.net and WordPress

I run a WordPress website that often has posts with some JavaScript, usually for various calculators. For example, I might use JavaScript to allow a visitor to convert inches to mm. That's a basic ...
0
votes
0answers
19 views

How to detect upload image page in plugin?

I want to check admin page (from what page image was uploaded) and make a new bundle of image resizing in my plugin. But I can't recognize on backend ajax "featured image" button on category page or ...
0
votes
2answers
38 views

Update media library attachments

I import image to wordpress via wp_insert_attachment. On frontend wordpress media library still don't know that image is imported. I need a way to update attachments in media library without ...
0
votes
0answers
29 views

change icon from a plugin

I'm using a plugin (tripadvisor testimonials). This plugin is using it's own icons in png to rate the comment on trip advisor. I wish change those icons by mine. I tried to do something in ...
0
votes
1answer
11 views

Unable To Call Javascript With Enqueue

I am using a child theme and trying to call custom JS from /child-theme/js/custom.js In my function file I have: function myprefix_enqueue_scripts() { wp_enqueue_script( 'my-script', ...
0
votes
0answers
17 views

Get value of HAL links of post fetched from WordPress REST API

I'm fetching a list of posts from the WordPress Rest API and receive them fine. After receiving them I want to display/work with the links passed by the API at the End of the response. The links are ...
0
votes
2answers
29 views

How can I put my own code in a wordpress page?

How can I put my own code in a wordpress page? This happens when I tried to
2
votes
1answer
44 views

What do the args for Gutenberg subpackage “hooks” function “doAction” mean?

The package is supposed to mime WP's own actions system: https://github.com/WordPress/gutenberg/tree/master/packages/hooks I've installed it locally and loaded up all of its modules, unfortunately, ...
1
vote
1answer
15 views

Manually mark imported photo as selected in media library

Using image/attachment ID I want to manually set image to be selected in media library in javascript. What's the simplest way to do this?
0
votes
1answer
128 views

Implementing Webflow JS in WordPress

I am trying to implement Webflow's horizontal scrolling in WordPress. HTML Webflow export (working): https://horizontalscrolling.demo.site/webflow/horizontal-scrolling/ My WordPress attempt (not ...
0
votes
1answer
22 views

How to disable/enable PHP plugin functionality based on a TinyMCE toggle-button

I am currently working on a plugin which sends WP posts to an user-specified REST API, every time a post is published. The problem: I don't want to send every post, I'd rather like the user to choose ...