A client side scripting language useful for making interactive web sites

learn more… | top users | synonyms

1
vote
0answers
64 views

How do I pass the id of my widget to javascript in the form function?

I would like to add a Quilljs editor to the admin area of my widget, but I am having trouble passing $this->id to javascript. I am using the foo_example widget code, and I've appended the ...
0
votes
0answers
83 views

Javascript file doesn't load

I have a mysterious problem - the script file isn't loaded. The same code works on a test server. But when we uploaded it to the live server and looking at the browser console at "sources", it didn't ...
0
votes
0answers
32 views

Use data-id for wordpress posts (individually)

I get the filters script implemented on my wordpress web by some developer, who's not good in wordpress functions but he did implement the filter script on web. That script is working on projects ...
0
votes
1answer
13 views

Link to page with posts of specific type

This might be a stupid question, but I am having difficulty finding an answer on google. I have a section of my site that loads 4 divs with a post title, excerpt and 'read more' link to the full post. ...
0
votes
1answer
812 views

Woocommerce Ajax Add cart not working

In woocommerce ajax add to cart method not adding when cart is empty, if cart contains something then my ajax function adds but if cart is empty it doesn't add. And no error. Here is the link. PHP ...
0
votes
1answer
37 views

Getting 404 in the Javascript

I have directory called "api" and in that I want to run a php script called "tweet.php". This script file is calling inside a JS file. However I am getting a 404. Need help to solve the issue. Link ...
0
votes
0answers
30 views

Getting Menu Items Parameters in Javascript Loop

I'm using the Menu Image Plugin - https://wordpress.org/plugins/menu-image/ It adds a image to the menu I need to extract or output the menu items ie Name, Menu-Url, Menu-image into javascript loop, ...
0
votes
0answers
15 views

Customize navigation menu in the Twenty Fifteen theme

Is it possible to change the behavior of the navigation menu in the Twenty Fifteen theme so when a user clicks a menu item to open a submenu all the other already opened submenus are closed? I'm ...
0
votes
1answer
38 views

Menu Details Output in Javascript [closed]

I have to output page, parameters( Page Url, Page Name, and Page's featured image) in javascript loop, one by one I think we can display it through NavMenuItems or NavMenu functions Pages displayed ...
0
votes
0answers
22 views

Detect when media select input field has been populated in a plugin

I have some code in a little plugin I am trying to make that allows a user to select an image to use : <input type="text" name="thumbnail_adr" id="thumbnail_adr" class="regular-text" ...
0
votes
0answers
17 views

How to limit each front-end user to view just his own uploaded files on Amazon S3?

In my Wordpress website Users can upload video files directly to a Amazon S3 bucket, all of them use the SAME bucket for their uploads. After the upload is done each user should be able to view/delete ...
0
votes
2answers
25 views

JavaScript in page doesn't open new window [closed]

I have this code: Search: <input type="text" id="fname" onkeyup="myfunction()"> <a id="sear" href="" target="_blank">Search</a> <script> function myFunction() { var x = ...
0
votes
2answers
36 views

Script not working in post content

I have this code: Search: <input type="text" id="fname" onkeyup="myfunction()"> <a id="sear" href="" target="_blank">Search</a> <script> function myFunction() { var x = ...
-2
votes
1answer
30 views

How to make a rest style plugin?

I created a plugin that is basically a crud to write to the mysql database. I want to know how to display the data on a wordpress page. I'm reading about url rewrites but it seems rewrites are for ...
0
votes
1answer
93 views

How to use Amazon Elastic Transcoder from Wordpress using AWS SDK for PHP?

Use Case: The user uploads his video from the frontend of my website in any format he wants to Amazon S3. Now I want to covenrt that video file to MPEG-4 using Amazon Elastic Transcoder by applying ...
0
votes
1answer
37 views

How to create a dashboard for logged-in users with custom functionality? [closed]

I am developing a Wordpress website in which each logged-in user should have a dashboard from which (s)he can upload video files. Each user has an upload limit of X GB. He also should be capable of ...
0
votes
0answers
16 views

Wordpress Customizer - reload controls

I have several controls setup, one of which is a custom multi-select field which allows you to select several different options, based on these selected options I tailor make other sections/controls. ...
2
votes
1answer
64 views

What type of template are WP media-modal's templates?

I was looking at the Wordpress templates (html that's written to the page instead of awkwardly adding strings in JS). There are a lot of templates like this in a post editor for example: <script ...
0
votes
0answers
64 views

Trying to update User Meta with Ajax

I am trying to make a plugin to record the users browser based location as user meta data stored as Latitude and Longitude. This current version is trying to make user meta via form, but ultimately I ...
0
votes
3answers
28 views

Why doesn't jQuery use $, and how can I get it do so (GLOBALLY)?

I have a WordPress theme that includes jQuery, but for some reason the "$" doesn't let me call jQuery. I know I can wrap jQuery calls in an anonymous function, but I have other plugins that rely on ...
1
vote
1answer
23 views

I need to get an array from the wordpress database

I need to convert this code //This creates an array from the database and allows us to use it later in the jquery //CREATE SQL STATEMENT $sql_locations = "SELECT * FROM tbllocations"; //EXECUTE SQL ...
0
votes
0answers
16 views

multiple_loop of filterable taxonomy_portfolio for CPT

first sorry for my "school-level" english and for possible mistakes (it's the first time on this forum) I have a CPT "corso", I have more taxonomy for this CPT (argomento1, argomento2, ...) and I've ...
1
vote
1answer
33 views

What are the options for running custom css and javascript files on a page?

To include custom css and javascript within a blog post or a page, one option would be to embed a jsbin, codepen, or plunkr link. In cases where you wanted to include external libraries like ...
0
votes
1answer
33 views

JavaScript problem in a WordPress PAGE

I did a simple HTML page which has JavaScript as following: <script> function myFunction() { var y = document.querySelector('input[name="mum1"]:checked').value; var z = ...
0
votes
2answers
86 views

Enqueue js script to footer

I need to run wp_enqueue on javascript files after the DOM has been populated because I need to target a div. EDIT I am trying to add the following three scripts: wp_enqueue_script('react_js', ...
0
votes
1answer
526 views

How to use Readmore.js? [closed]

I am trying to use Readmore.js for WooCommerce category description "Read more / Close" functionality. I enqueue the JavaScript and add $('article').readmore(); in the "Insert Header and Footer" ...
0
votes
0answers
20 views

Can anybody explain why this js value is set at 10 in this media library source?

I'm using Mike Jolly's media uploader plugin on one of my Wordpress plugins which opens the media library as a shortened popup. Generally it works, but line 4 of the main code includes the following ...
1
vote
2answers
103 views

Searching multiple tags and adding jQuery dependant script onto page template?

I have this simple javascript file for checking boxes in a tree view menu: treeview.js $(".acidjs-css3-treeview").delegate("label input:checkbox", "change", function() { var checkbox = ...
0
votes
0answers
35 views

Call attributes from shortcode function to a JavaScript function?

How do I call attributes from shortcode function to a JavaScript function? extract(shortcode_atts( array( 'xyz' => '' ), $atts )); I want to call xyz's value in ...
0
votes
0answers
22 views

Accessing tags from the front end

I would like to access the tags that are assigned to a post from the front end (JS). Is there a hook / object I can tap for these?
1
vote
1answer
91 views

TinyMCE 4 remove/add attributes for all images

i want to search for all images that have been add to TinyMCE 4 and: Remove the height attribute from the images Add style="max-width: 100%;" to all images what is the best way to do this tasks? ...
1
vote
0answers
56 views

Using React.js in WordPress

I want to add a "Widget" that is built with React.js to my WordPress site. It will not be dependent on any outside data. Besides adding npm modules and adding build processes to my Gruntfile (to ...
0
votes
1answer
18 views

Slider from different widgets

I need some advice. I have added the possibility to pages to have categories with a plugin. I have created a widget for a client that lets a user select a category from a page and select a subpage ...
0
votes
0answers
22 views

Widget Admin page and Javascript enqueuing

I am authoring a WP Widget plugin, and am having problems enqueuing javascript onto the Widget Admin page. The Javascript works when the page is first loaded or refreshed, but when you click "Save" on ...
0
votes
1answer
59 views

How do I know if I should enqueue JS code or just include it in ONE PHP function?

I've read in tons of articles that enqueueing is the way to go...blah blah blah....but does that only apply to when the JS code itself will be repeated across many pages? For example, I have a bit ...
0
votes
0answers
130 views

Get URL of current featured image with JS in edit post view

Is it possible, somehow, to fetch the URL of the currently set featured image when you're in the edit post view? So far I've looked at fetching via jQuery such as: var url = ...
0
votes
0answers
23 views

Should I be worried about this error when enqueueing an external JS file? Everything still works

I enqueued a JS file that contains the below code. I can tell that the JS file is working correctly and being used. However, the browser console gives me an error Uncaught SyntaxError: Unexpected ...
0
votes
2answers
39 views

Normal for scripts to be loaded after body tag?

Why are there WP scripts being loaded after the <body> tag? Is this the norm in WP? These scripts seem to be WordPress's own and not from the plugin/theme I am using. The image below is a ...
3
votes
1answer
138 views

Refresh wp.media after ajax call

I'm building a plugin where i add a tab to the media manager and can add stuff from another source. I add the tab with this, which generates a iframe; add_filter('media_upload_tabs', ...
0
votes
0answers
31 views

video preroll vimeo in wordpress

Hello guys I would like to integrate an open source code taken from github to my wordpress theme. link: Vimeo Pre-roll This is the code of my video.php, I would like to work with vimeo. code: ...
0
votes
0answers
43 views

WP API Get Request Dynamically Load the_content

I have formatted my posts as follows, using the normal Loop: the_title the_date the_excerpt Using a "Read More" button onclick and the WP API v2 JSON data, how can I dynamically expand the post to ...
0
votes
2answers
39 views

How to identify which javascript is being executed

I am trying to figure out which script is being called and executed within my Wordpress website. I have website with a number of scripts that are included by the core, the theme and the numerous ...
0
votes
1answer
15 views

Referencing files in JavaScript in WordPress Plugin

I have a JavaScript file in my plugin in which I need to reference a sound file to play when any link is clicked in any front end page. I did it like this: my_plugin/my_plugin.php function ...
0
votes
0answers
97 views

Adding number of items in cart at the beginning of the <title> tag using Javascript

I'm working on a WooCommerce site and I'm trying to add the number of items in the cart, inside of the <title> tag. The thing is: I've been looking for all over the place where the ...
0
votes
0answers
46 views

Change view and refresh wp.media

I'm building a plugin which adds a new media tab. In this tab i display an iframe in which i can select images from another source and upload them to wordpress (using ajax). This works just fine, the ...
0
votes
2answers
27 views

I can't enqueue my scripts - They literally aren't being added to my site

Ok, I've literally copy-pasted different enqueueing code from about 5 different sources (Including wordpress), and not a single one works. Here's the code I'm using in functions.php: <?php ...
0
votes
0answers
17 views

Protect my plugins document ready JS from errors from other plugins

I'm creating a plugin where I add some event listeners etc. Nothing fancy. I'm using the document ready event and it's working fine. The only problem is, that other plugins may cause JS errors into ...
1
vote
0answers
97 views

Making a custom widget that includes a tinymce and works in Site Origin Page Builder

For a client I'm using Site Origins Page Builder plugin. It enables the client to make rich layouts for each page by dragging and dropping widgets. Site Origin widgets that require a WYSIWYG-editor ...
0
votes
2answers
168 views

Delay JavaScript files from loading

I need to delay AngularJS scripts from running so I can set up my application first. I need to initialize the application with ng-app="app". I want to add that attribute to the < body > < body ...
0
votes
0answers
29 views

Removing options from attachment details

In the image gallery section of my Wordpress admin, when I click on an image I get something like this: My site allows multiple users to add images and I feel that most of these fields are ...