Questions tagged [plugin-development]

WordPress Plugins allow easy modification, customization, and enhancement to a WordPress blog. Instead of changing the core programming of WordPress, you can add functionality with WordPress Plugins.

Filter by
Sorted by
Tagged with
0
votes
0answers
11 views

developing a wordpress plugin, have a few PHP Woocommerce related coding questions

Background: I hired a programmer to create a schema markup plugin for me, the job was done but a few things have left that need to be added. We added a separate code where it adds fields such as "...
0
votes
1answer
11 views

Execute plugin for specific user role only

I have a custom developed plugin which I would only like to execute for one particular user role. Within the plugin's main (top level) file I have the following which I believe initialises the plugin (...
0
votes
0answers
9 views

Add Plugin options as subpage to Theme options page

I have my own Theme with an options page. Now I am developing a new Plugin which should have an options page that should be a subpage of the Theme options page. Theme options.php: <?php function ...
0
votes
0answers
12 views

Is there any kind of theme on WordPress to sell my own movies?

Hope you all are doing well. Sorry if it is non-related topic in this website, but I was struggling to find an answer for my question. I would like to create a website on WordPress where I could put ...
0
votes
0answers
17 views

Word press and PHP error caused these errors [duplicate]

Warning: Declaration of Thesis_Comment::start_lvl(&$output, $depth, $args) should be compatible with Walker::start_lvl(&$output, $depth = 0, $args = Array) in /data/25/0/30/26/30678/user/...
0
votes
0answers
15 views

WordPress AMP Plugin Blocking JavaScript [closed]

I have an issue in wordpress site, i have to use AMP Plugin for mobile page speed increase but,some javascript are blocked by AMP. I have to enable blocking javascript to unblocked what can i do. ...
0
votes
0answers
11 views

Write test for magic method __clone for plugin development

I implemented the Design Pattern Singleton in my Plugin. and I want to test the magic __clone () method to not allow cloning : /** * Cloning is forbidden due to singleton pattern. */ public function ...
0
votes
0answers
9 views

How to apply not existing coupon in woocommerce

I am using this code this is working perfectly till checkout. function royal_woocommerce_filter_checkout_for_coupons( $subtotal, $compound, $cart ) { // Your logic to get store credit value for ...
0
votes
0answers
10 views

Why is one phpunit test throwing an error on one class when all other classes are similar without error?

I'm working on the Liquid Messages plugin. There are some basic PHPUnit tests existing for it and when I run phpunit all pass except for one. It errors out: There was 1 error: 1) GCS_Async_Test::...
1
vote
1answer
9 views

Autoload via composer in plugin interference

I am using wordpress 5.3.x. and I am using "fabpot/goutte": "^4.0" in my composer in one of my wordpress plugin. In my theme I am using "fabpot/goutte": "^3.8". Both are using require_once 'vendor/...
0
votes
0answers
18 views

Adding External Gmap JS to WordPress

I had some working javascript code that I wanted to move out of the template file and put into a .js file. I moved the code into a front.js file, where some pre-existing javascript lives. Now I'm ...
0
votes
1answer
19 views

Adding Amchart Interface to Wordpress API

I'm using the amchart wordpress plugin and want to add support for it via the wp rest API. Here's what I've done so far: in ../includes/setup.php (To $args array I've added: This will create the /...
0
votes
1answer
12 views

Using id to show item

Im working on a project where i upload a gpx file and use the path of gpx to put in a shortcode plugin i use the post id the get a filled in shortcode i use this code to get me the piece of info for ...
0
votes
1answer
21 views

How to override theme's public static function inside of a trait?

I use a theme which has a public static function to display a part of a page like: trait SomeTrait { public static function some_function() { ?> <div class="some_class">Some ...
0
votes
0answers
11 views

How to sort uploaded images into folders based on Post_ID

I would like to sort uploaded images (Media Libary is on) into Folders based on the Post-ID. Id did try to use the solution How Can I Organize the Uploads Folder by Slug (or ID, or FileType, or Author)...
0
votes
0answers
9 views

pass datetime using wp_localize_script to frontend from settings page

Is possible to use the wp_localize_script fom the front-end? I'vecreated a JS countdown timer that will take an input data from a settings page fom backend. The script that will display the countdown ...
0
votes
0answers
12 views

register_setting not save checkbox

To understand the Settings API I'm creating a custom settings page for a custom plugin. I have some trouble to save the settings, I have a single checkbox to test if the code works well, but if I ...
0
votes
1answer
19 views

Custom array from a query only write the last row of the query

Looking for some input on this one. I am writing a custom array but having a strange issue. It seems to be cycling through the loop and dropping previous values and only storing the last row of the ...
0
votes
0answers
10 views

Integrate options to maintenance screen plugin

I have a simple custom plugin to show a maintenance screen to non admin users. I want to integrate some options to it like a countdown and a selectable background image or color and a custom logo. I ...
0
votes
1answer
15 views

ajax response strips multidimensional array and unable to decode

I am using the wp_ajax_ and wp_ajax_nopriv_ in localize script I am passing a big multidimensional array( it's big!). It works without any JSON encode, decodes. But I want to encode it is while I make ...
0
votes
1answer
28 views

PHPUnit Testing and woocommerce Constant

I tried to perform a test on the WC_VERSION constant. The main class : class WC_Custom_Variable_Products_Dependencies { /** minimum WooCommerce version required by this plugin */ const ...
0
votes
0answers
21 views

WordPress: Develop multiple posts with different data

I have a landing page of multiple books as a post, I want to display each book in separated post, in each post has a book name,download link,image and size. All books posts has same design with ...
0
votes
1answer
29 views

I cant add is_admin control to plugin

I want to hide my plugin on admin pages because its conflict with that.however when İ add the control, wp says there is critical error. İ want to add this control: if ( ! is_admin() ) { // Runs ...
0
votes
0answers
14 views

create custom page builder

I want to create a custom and simple page builder as an exercise to improve my wordpress coding skills. I want to integrate bootstrap 4 inside it, and as tutorial I was reading this article. It's very ...
0
votes
1answer
17 views

add custom metabox to media library custom widget

I'm implementing a custom widget to create a logos slider. The initial code works well, but when I have added a metabox to the attachment screen to let the user add an external link to the images, I ...
0
votes
2answers
25 views

using filter and hook inside class

I'm going deep with oop to create wordpress plugins. I've found an interesting article about the hooks and how to use them inside a class. After reading I have some doubt: is correct to use the hooks ...
0
votes
0answers
32 views

Stuck with WooCommerece Payment Method Plugin (custom coded)

I am development a plugin for custom payment method for WOoCommerce, where in "public function result()" function I want to access/get product id which is bought. Below is my code so far but it is ...
-1
votes
0answers
11 views

How to Receive and Process Paypal IPN on a WordPress Page

I have created a WordPress Page template(listener.php) and then created a WP page using that template.The Page url is like: mysite.com/thank-you. Here is the code i have place in the template(listener....
0
votes
1answer
20 views

Unit Testing action hook

I want to perform unit tests on a Class, my goal is: I want to check if the plugin is activated or not by using the function: is_plugin_active class WC_Custom_Variable_Products_Dependencies { ...
0
votes
0answers
30 views

add tags to wordpress post using REST API

I'm new to WordPress programming and I'm trying to connect to WordPress REST API and send a new post with content and many tags. I can connect to API and send a new post but I can't add tags to those ...
0
votes
0answers
18 views

Redirect WooCommerce checkout to cart

how can I redirect customers to cart page when they click on checkout link? I found many tutorials to redirect in the opposite sense (cart to checkout) but nothing for my purposes...
0
votes
1answer
21 views

Add a check box in Menu Settings

I'm looking for the appropriate hook to add a check box in Menu Settings, and if it exists, how to save the value as an option .
0
votes
0answers
12 views

how change add to cart button text and show text with added quantity of product on shop page without page load

function change_button_text( $product_id, $button_text ) { foreach( WC()->cart->get_cart() as $item ) { if( $product_id === $item['product_id'] ) { $itemq = $item['...
0
votes
1answer
11 views

Multiple image selection custom widget

I've created a swiper custom carousel as template part of a custom theme. I want to widgetize this component of the theme to have more control over the contents displayed. It's used as an horizontal ...
0
votes
0answers
10 views

First page download plugin

I'm sorry, but I speak a little English. I would like create a WordPress plugin. All page view run this plugin, but if a visitor has not been to my site yet, I would like a cookie to be generated: $...
0
votes
0answers
15 views

implement checkbox or toggle switch in plugin code

I need to implement a way to let the user decode a base64 string from the front-end. I want to add a toggle switch or a checkbox that if selected will encode or decode the input string. Is there a way ...
0
votes
0answers
16 views

500 Internal server error wp_handle_upload_prefilter

I get a 500 error after I've added the wp_handle_upload_prefilter to my plugin class. How I can fix this? require_once 'vendor/autoload.php'; class MyClass { public function __construct() { ...
0
votes
0answers
7 views

rename and manipulate image during upload

Thanks to your support I've learned how to manage the uploads in wordpress. I'm writing a plugin that will do some manipulation on the images that an user will upload from the front-end. I need an ...
0
votes
0answers
19 views

wp_insert_attachment adding numeral to file name

I have a situation where I am pulling images from an exterior wordpress blog, which also happens to have images. I am able to pull the links and titles of the latest posts, as well as the featured ...
0
votes
0answers
15 views

wp_handle_upload - specified file failed upload test

I'm using the wp_handle_upload() function to create a plugin that will give to the users the ability to upload files from front-end using ajax. I've solved an issue relative to an error in the syntax, ...
0
votes
1answer
27 views

WordPress Query doesn't return the correct value

According to this page: Return #Return (int|bool) Boolean true for CREATE, ALTER, TRUNCATE and DROP queries. Number of rows affected/selected for all other queries. Boolean false on error. ...
0
votes
1answer
16 views

400 bad request admin-ajax file upload

I'm having some trouble while I'm making an upload plugin. I'm using ajax to do the upload, but during the first test I get a 400 bad request error. Is there a fix for this? Here is the js code (...
-1
votes
0answers
18 views

Set Default Value by two fields(attribute) in WordPress

I have some several fields in custom post code name ..... .... code name search(combination of code and name) -->Make field "Read Only" in UI anyway to concatenate code+name into 3rd attribute(code ...
0
votes
0answers
26 views

Wordpress Own Rewrite Rules

i am trying to rewrite a URL with the following code in functions.php add_action('init', function() { add_rewrite_rule('/agbz\/(\w*)\/\?page=(\w*)&memberID=([a-z]{1}\d*)&land=(\w*)&...
0
votes
2answers
26 views

Image upload and download from front-end

I'm making a web app using wordpress, the app will include this library that will do some steganography operations. I need some help to understand how to implement a front-end image upload for the ...
0
votes
1answer
24 views

How to add apply_filter for a class property in plugin

I am trying to add an apply_filters function to a property of a class so that the form fields could be added to from another plugin or functions.php but I just can't get the $filter_fields to set. Can ...
1
vote
1answer
41 views

WordPress custom authentication implementation

I created a plugin to allow my website to have its own login functionality. My project has a new requirement which is to log in to the user with my own authentication method and not the one provided ...
1
vote
0answers
26 views

Append wp_editor to Dynamically created textarea

So...the same question was asked 9 years ago: Dynamically textarea with TinyMce editor and I dont see a good answer and we now have the wp.editor API. Ive tried a few things, but cant add a WSYWIG ...
0
votes
0answers
55 views

How to display the Mailchimp subscribe popup form on click [closed]

I am using WordPress. I have to display the Mailchimp subscribe popup on click on the button. I found some URL https://medium.com/@rekommend_io/mailchimp-pop-up-based-on-click-a0975374c804 https://...
0
votes
0answers
16 views

Store user form submitted information in post type

I'm building an internal peoples directory using wp for a client. I'm styling the search form and the search result page that are working fine. I need some help to understand what's the better ...