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 [scripts]

The tag has no usage guidance.

0
votes
0answers
22 views

Python Wordpress- ImportError on certain python modules

I created a custom plugin to execute python in wordpress as seen here: Running a python script within wordpress It works well mostly, except certain packages in the python script yields ImportError ...
0
votes
0answers
19 views

List All Enqueued Scripts and Styles

Is there any way to list which scripts and styles have been enqueued, while within wp-admin? For example this code works, but only if you are on the frontend. How could I get the same list while ...
0
votes
0answers
21 views

Set Post Thumbnail to external URL

This question is with regard to feature images on WooCommerce product post types, however it should probably apply to any post type. I am running a custom script to create new posts (of type product) ...
0
votes
0answers
23 views

Prevent malicious scripts to be submitted in post

I am building a wordpress backed web application where users will submit posts. Is there any way to prevent malicious codes from being submitted (by way of hooks or filters)?
0
votes
0answers
19 views

How to use the WordPress API to get links and scripts in <head> and <body>

I'm using the WordPress API as a headless CMS. I have Elementor plugin installed to do page building in the WordPress admin. I'm trying to figure out how to get all of the <link> and <script&...
0
votes
1answer
20 views

Completely isolate a plugin view so it doesn't load the theme

We're making a WordPress plugin that generates an iframe with a shortcode, and that iframe that should work and display the same no matter what site, page or theme it's used on. The view is located at ...
0
votes
1answer
39 views

Wordpress 5.1 upgrade has lost the parent theme JavaScript

I have just upgraded from Wordpress 4.9 to 5.1, which obviously comes with Gutenberg. One major problem I have is that the parent theme (BeTheme) JavaScript is not being loaded and instead the child ...
1
vote
0answers
113 views

Repeating admin-ajax.php not found error in admin

I seem to be getting a repeating 404 error in the Chrome console when in wordpress admin very occasionally it gets marked as a 500 error for the same line, perhaps is something to do with an ...
0
votes
0answers
6 views

Printing extra scripts before src scripts to optimize minification and page speed

In WordPress a plugin may add extra data to be printed before or after a script when enqueueing a script. Quite a few plugins that we have enabled do this to define for example an ajax URL etc and it ...
0
votes
0answers
42 views

moxie.min.js and plupload.min.js

I want to make a defer to the following scripts but I can not find them in the documentation : wp-includes/js/plupload/moxie.min.js wp-includes/js/plupload/plupload.min.js I appreciate a help.
1
vote
1answer
254 views

Select2 in WordPress

I have seen some best practices in WordPress about enqueueing scripts in WordPress. The scripts that are already in WordPress core should not be added again, but call that from WordPress core. I want ...
0
votes
1answer
46 views

How to Get Rid of Unwanted Backslashes in WordPress Form Input inside admin menu option

I'm building a simple plugin that allows adding custom scripts to header and footer. Everything seems to work fine, but there is a 'bug'. When I add Google Analytics script to header, it shows with ...
0
votes
2answers
25 views

Enabling plugin on specific pages and subpages

To increase the loading speed, I would like to only enable Event Manager plugin on the pages where it's actually used. For that, I wrote this piece of code: // deregister unnecessary plugin scripts: ...
1
vote
0answers
28 views

Styles and scripts inside template part

Is there anything wrong with including style and script tags inside a template part? The template part which I'm using like something more similar to a vue/react component is working correctly but ...
1
vote
2answers
173 views

Loading jQuery in the footer after removing jQuery migrate?

I am removing jQuery migrate in WordPress in this way: add_filter( 'wp_default_scripts', 'remove_jquery_migrate' ); function remove_jquery_migrate( &$scripts ){ if(!is_admin()){ $...
0
votes
0answers
153 views

How to add ID3 tag of a mp3 folder automatically when creating a WordPress playlist?

I am working on a mp3 wordress website. Currently I am uploading mp3 files using filezilla. After uploading I copy their url one by one and paste them in playlist post, then I need to edit mp3 title ...
0
votes
1answer
25 views

How to generate/create link automatically on every word of post in wordpress

I am working on a poetry site and I am new to wordpress. I want to publish poems of various authors on my site. What i want is that when i publish a post, a link/onclick event on every word of post ...
0
votes
0answers
16 views

Support MagnificPopup for posts images

MagnificPopup requires the parent of the image to be a tag with href attribute contains the image link. After searching I found that the problem can be solved by add data-mfp-src attribute directly ...
2
votes
1answer
16 views

Unable to load stylesheets and scripts to plugin settings page

I have the following code in my main plugin file: <?php /* Plugin Name: Awesome Slide Show */ add_action('admin_head', 'wp_ss_plugin_include'); add_action('admin_menu', '...
3
votes
1answer
70 views

Why Allow Script Commands in Comments?

I noticed that if you are an admin or editor, you are able to put in script code like this in comments (not in the page/post editor) for admin/editor roles: <script>alert("Danger, Wil Robinson!"...
1
vote
1answer
40 views

Why won't my scripts load?

I am having trouble loading scripts in functions.php I've done this before so I'm sure I'm overlooking something but as far as I can tell it is correct and I have tried copying and pasting from other ...
1
vote
1answer
60 views

Writing scripts using Wordpress / WooCommerce classes?

I have various processing scripts I want to run that modify WooCommerce order data. Currently, I build the scripts as a function in my theme's functions.php and then attach the function to a shortcode....
0
votes
0answers
165 views

How to get WP-CLI to work with bash scripts?

I have wp-cli installed on a WHM/cpanel server running multi-php versions with EasyApache4. I am able to use wp-cli when Im either in the directory where wp-config resides or I use the –path command ...
0
votes
1answer
23 views

Add Custom Taxonomy into Script

I am trying to add a script for an affiliate widget into the back end of my website so I can use a custom taxonomy for the variable. Basically below where the script asks for destination I would like ...
0
votes
2answers
417 views

How can I load an inline script after the enqueued scripts in admin?

I am having a heck of a time finding an answer to this solution. I have googled everything I can think of but I can't find anything. I want to load an inline JavaScript tag in the footer of the admin. ...
0
votes
1answer
47 views

Hardening uploads folder in IIS breaks images

My site loads a bunch of images from the uploads folder, using direct URLs, such as: http://www.example.com/wp-content/uploads/some.image.png I'm trying to figure out a remote script execution issue,...
0
votes
1answer
49 views

how to call other plugins once custom post has been inserted

i built custom script to import woocommerce product using (wp_insert_post) and i want to call other plugins to insert their data to each new products to db for example: after inserting product if i ...
1
vote
0answers
122 views

Shortest script to install a WordPress webapp on Nginx

The following script is the one I use on Ubuntu-Nginx environments, to get a WordPress webapp up and running. I run it with a domain as an argument: bash ~/nwsm.sh example.com My question is what ...
0
votes
1answer
29 views

WordPress url transformation script

Does anyone know of or have suggestions for how to go about setting up a WordPress url transformation script - perhaps via a plugin or one-time run script? It would be used to correct installs which ...
1
vote
2answers
1k views

How to remove some external js files from source?

I need to remove some external .js files from source here is source: view-source:buhehe.de/ausmalbilder/ There is 3 jquery library and I don't know what is difference, why is it not one enough? <...
0
votes
2answers
594 views

wp_dequeue_style and wp_dequeue_script not working on server but does work on local xampp

This is my entire code and it is working perfectly in my local system xampp but not working on server. function taqyeem_dequeue_scrips() { if(basename($_SERVER['REQUEST_URI'])=='my_page' || ...
1
vote
2answers
283 views

Change directory of javascript files

I'd like to move all my assets (CSS, JS, Images, Fonts) in an asset folder in my theme. I did it very well for the fonts and images. For the CSS, I just kept the style.css with the style meta ...
0
votes
3answers
52 views

Using jquery with wordpress using wp_enqueue_scripts

I need to include jquery in a single page template of my theme. But it looks like it doesn't want to. I tried calling it with wp_enqueue_scripts() but i does nothing. Here is what is in functions.php ...
0
votes
1answer
237 views

style.min.css code issue

Okay, My site report is here that I am developing - https://tools.pingdom.com/#!/bBE0r0/www.waggypetservices.co.uk/ My only issue now is that something is calling style.min.css when this doesn't and ...
0
votes
1answer
18 views

Javascript asset not enqueuing with the rest

I am working on a project that uses the child-theme's functions file to enqueue a stylesheet and a single javascript file. These two resources are enqueued well. However, when I add a new compiled ...
2
votes
3answers
309 views

wp_register_script multiple identifiers?

In order to avoid poor performance with multiple <script> tags I do concatenation of scripts regularly and produce one single bundle.min.js JS file and 'jsbundle' identifier. Problem is, things ...
0
votes
1answer
35 views

Script not loading when depending on jQuery

As soon as I add the $deps array to my wp_enqueue_script, the script is 'enqueued', but not 'done'. Any ideas? function bootstrap_script_init() { wp_register_script('bootstrap', ...
0
votes
1answer
60 views

Enqueued admin javascript for plugin settings page not executing

Here is how I am enqueueing the script (this is inside a class): add_action( 'admin_enqueue_scripts', array( $this, 'add_admin_scripts'), true); public function add_admin_scripts(){ $parentBase =...
2
votes
0answers
15 views

How to add unique image class to Wordpress

I want my in-image ads to appear only on the first long vertical images of my blog posts. I need to add a unique image class to the first images, but I don't know how to do this or what code to use. ...
1
vote
1answer
604 views

How can I add my script to admin using script-loader.php?

I'm trying to load my custom script in the admin panel using the same method that WordPress itself loads scripts in the admin area. This is an example script being loaded by wp-includes/script-loader....
1
vote
1answer
614 views

Wordpress doesn't Load JQuery Now? Do I need to enqueue JQuery also?

In my HTML I was loading JQuery, but I am not loading it when converting HTML into the Wordpress. because I think WP automatically loads it. However there is a custom.js sitting in the js folder, and ...
2
votes
2answers
1k views

How does WordPress create its database during installation?

I am new to WordPress and I'm trying to understand it. I searched for a .sql file in WordPress script but couldn't find any. Wm kinda confused and want to know where the database entries and ...
0
votes
1answer
39 views

How to use custom Javascript code inside a plugin?

So, I have a custom Javascript code that inserts a pop-up widget in a webpage. The source code is irrelevant but it works by manually pasting before the <\body> tag of the website, such that: &...
0
votes
1answer
91 views

Why is JavaScript being added to header as application/oembed?

I created a short JavaScript file and placed it in my theme's JS folder, the contents of the file are: /** * Text2Give Functions File * * Mobile Landing Page Functions File */ jQuery( function( $...
0
votes
1answer
45 views

Automatic Wordpress Clone Backup

I currently manage a website for my company - entirely internal, only employees can view. This website is very important for the company's workflow throughout the day, and database information for ...
0
votes
1answer
1k views

Add table to WordPress database

I want to add an extra table on my WordPress database and I intend to query it with a custom script that will be embedded to WordPress. I'm worrying if this is a safe way to do it, or I should go ...
-3
votes
1answer
390 views

Change color of a specific word generated by script [closed]

I'm trying to adapt a code to change the color of a single word, but I have no idea how. The original code is crypt_single_getPar = eval('(' + httpGet("https://api.cryptonator.com/api/ticker/" + ...
1
vote
0answers
26 views

Custom tag being removed from text editor

I have visual composer installed. I have a special "weather widget" that I need to add to a page, but it keeps getting stripped when I add it into a text block. <wx:widget type="alerts" template="...
2
votes
1answer
514 views

Disable unneeded scripts in a wordpress installation

I have inherited a quite bloated wordpress website that runs really slow even on dedicated hosting. I am trying to optimize the speed of it. I have run the website through different websites that ...
0
votes
1answer
71 views

How can I get my Media Uploader Button to function on 1 click rather than requiring 2 clicks?

UPDATE: I have corrected the below code, to reflect the answer which resolved my issue. I have created a Custom Admin Page and have managed to get all of my Fields and Save buttons to work. Within ...