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
19 views

How do I access the contents of Wordpress editor in admin area with JavaScript?

I am working on a small Wordpress plugin which uses JavaScript to add html tags with a css class to the visual text view in the Wordpress editor. I use the Classic Editor but would like to know a ...
0
votes
1answer
33 views

Count products with custom metadata field in an order

I have a wordpress plugin which performs a count of purchased products in an order which are flagged with my custom metadata value. The custom metadata value is in the form of a checkbox within the ...
0
votes
0answers
17 views

How can i set path parameters for a webhook? [closed]

I'm using webhooks for a plugin developpement, and i struggle to get back data when the external Api call the hook. I have tried using the $_GET provided by the webhook function but it is empty. Is ...
0
votes
3answers
7k views

using wp_footer hook in a plugin

I'm using the wp_footer hook into the plugin and it doesn't work, but when I copy the code to the "functions.php" file of the active theme it does work, what is the possible problem in this situation ?...
1
vote
2answers
3k views

get 404 when accessing wp-admin/plugin-install.php

While freshly installed, I cannot access the 'Add new plugins` page whatsoever. It just keep waiting & then redirect me to 404 page of the current theme. I'm not sure what went wrong as the ...
0
votes
1answer
1k views

Best way to handle a form post in plugin

I'm doing a plugin that needs to be able to post data to a third party API. Users will fill out a form and press submit. The form itself - would it be "correct" to simply append html to a page ...
0
votes
0answers
20 views

script seem not load with use wp_enqueue_script

edit : I unlocked using the rest api and not ajax (so no js) thanks to the response of Tom J Nowell I'm pretty new in wordpress plugin dev I want to load some js for a plugin with ajax request. To do ...
0
votes
1answer
2k views

Checkbox field that add a subscription product and change prices of other products in checkout and cart page

In Woocommerce checkout section, I am trying to add a checkbox that adds an additional subscription product. It is working fine and I took help from here One more requirement is that if there are ...
0
votes
1answer
960 views

User avatar-ACF fields

I'm running wp multisite and using ACF custom field (user edit) for my local avatar, in my functions.php i added : add_action('get_avatar', 'tsm_acf_profile_avatar', 10, 3); function ...
0
votes
0answers
32 views

Unable to access the wp-admin facility at localhost:port/wp-admin [closed]

NOTE: This topic was closed and i don't know WHY since it deals specifically with WP server configuration, which this forum is advertised to be specifically FOR. I did come up with a workaround, which ...
1
vote
1answer
45 views

Set a specific page as 404 - not found via my own plugin

I'm developing a plugin that create some pages and set a specific template for each of these pages. It creates a page in which it sets a template for 404 - not found, how can set this specifc page as ...
4
votes
1answer
810 views

Custom frontend page for plugin without a 'physical' page?

I need to create a frontend page (and sub-pages) which will display custom data that is saved in the database but is not part of wordpress, it is not a post or page as such but API called data. I do ...
1
vote
1answer
697 views

wp_dropdown_roles() to replace option value = code

I'm trying to replace a hardcoded dropdown list of roles in a plugin. Currently this is the code: echo '<select name="xf_user_role_' . $id . '" id="xf_user_role_' . $id . '">'; ?> <...
0
votes
1answer
19 views

Automatically download, install and activate plugins that my plugin depends, how?

I'm developing a plugin that requires a couple of plugins from WordPress repository to work correctly. Is it possible to download and install from WordPress repository and activate one or more plugin ...
0
votes
1answer
9 views

Conditional Generation of Image Sizes using add_image_size

The add_image_size function is used to add image sizes in addition to the default thumbnail, medium, large, & full which are generated in WordPress by default. Is there any way to only add those ...
0
votes
1answer
12 views

How exclude or skip post type with get_next_post_link

I have a post type called families where I add personal information of each family, inside the data there is an option called status. *IMPORTANT: The fields are created with ACF CUSTOM FIELDS These ...
0
votes
1answer
26 views

Integrating boxtal PHP library into a custom WordPress Plugin

I need to integrate this PHP library on my WordPress site. I read that you have to create a plugin or integrate it into the child theme. So I created a plugin and integrated the PHP library in the ...
0
votes
1answer
561 views

Single_template for a custom post type created from a plugin is returning an empty page

I'm trying to create a single template for the custom post type posts called 'press release' from a plugin. This is the code I added to my plugin: function single_press_release_template($...
0
votes
1answer
24 views

Settings API form - submit with AJAX

I'm creating a plugin where I have a dashboard that is done with Settings API. I'm trying to save data from that form via AJAX. Form: public function agy_dashboard_page() { ?> <form id=&...
0
votes
0answers
16 views

Query String Filtering API

Currently, I'm working on a search application that searches/filters stores(Custom Post Type) based on the store-feature(Custom Taxamonies) IDs. When I use the WordPress Fetch API, I can get the full ...
0
votes
0answers
12 views

try to add order item name column in woocommerce Analytics -> Orders report table (and output to csv file) [closed]

I am trying to add a column to the table provided by order in woocommerce analytics, and the item name (not product name) of this order is displayed on it. I added a hook and tried to extract all ...
0
votes
1answer
17 views

I'm having problems creating blocks for Block widgets

My gutenberg block js code wp.blocks.registerBlockType('beycanpress/cryptopaydonate', { title: 'CryptoPay Donate Box', icon: 'dashicons dashicons-money-alt', category: 'widgets', ...
0
votes
0answers
19 views

WC Fix Attributes - 'Add New' Not Searchable/Delayed

Installed the WC Fix Attributes plugin Version 1.0 | By Tofandel as found here: Slow Loading Attribute Select - WooCommerce Backend Works a charm and really speeds up searching existing attributes 10 ...
0
votes
0answers
25 views

How to Join wp_posts & wp_postmeta table using custom query

I am trying to create pagination for product details with the help of wp_posts & wp_postmeta table for my woocommerce custom code for admin area. There are 85 products in shop & i want to ...
0
votes
1answer
727 views

Add Button to TinyMCE Custom Menu

I've added a new button with a menu to the TinyMCE visual editor using this tremendously helpful tutorial but would now like to add further items to this menu depending on whether various post types ...
0
votes
1answer
856 views

Shortcode content is not showing. Only the [shortcode-tag] is showing

I am creating a small plugin where I am creating a few shortcodes. I am using Classic Editor plugin. Here is my code in Plugin.php: <?php /** * Plugin Name: Simple Data Visualizer * Description:...
0
votes
1answer
2k views

How does one set cookies in WordPress without getting the ‘headers not sent’ error? within WP

How does one set cookies in WordPress without getting the ‘headers not sent’ error? within WP, I can’t write a cookie that parses a shortcode without getting said error. Please note the snippet below ...
0
votes
1answer
26 views

Plugins ignored a line breaks or <br> tag in the WordPress comment functions

I found out there is a plugins for ticket support. It uses the WordPress comments functions in the ticket system reply. The issue is the plugin will not accept a line break or with <br.>. How ...
1
vote
1answer
2k views

javascript datatables in a plugin

i have a plugin that i've started developing, and i want to try to use datatables.net to display table data. i wasn't sure how to achieve this, and after searching and trying different stuff i'm lost....
0
votes
2answers
837 views

why is apiFetch throwing Unhandled Promise Rejection: TypeError: Object is not a function

I'm trying to diagnose a similar problem to this question, but in that case he wasn't depending on wp-api-fetch, and ... I'm pretty sure I am. I'm getting the following error: [Error] Unhandled ...
0
votes
3answers
928 views

Call function when save setting/option in custom admin page

I would like to call a function when a I save a setting/option in a custom admin page.
0
votes
1answer
11 views

Order by post_date does not work in Previous and Next post pagination

I have added a previous and next pagination with thumbnail for my single post template but it does not showing the correct previous and next post. Also, saw its showing the previous and next post ...
0
votes
1answer
756 views

Headers already sent on custom plugin (Export function)

I've developed a plugin and have an export function that exports data from wordpress to csv.. the issue is that the "Header" statement is causing the "Headers already sent error". I've checked ...
0
votes
2answers
29 views

Getting incorrect filepath inside custom block front-end output using @wordpress/create-block tutorial

I am following the official WordPress "Create a Block Tutorial" located here: https://developer.wordpress.org/block-editor/handbook/tutorials/create-block/ I used this as a starting point ...
1
vote
2answers
3k views

Plugin settings not saving

I'm having a devil of a time getting my plugin settings to save. I've gone through the code so many times I have to think I've simply missed something. I'm following the Setting API, but any changes ...
0
votes
1answer
974 views

Javascript in plugin not working

I'm working on a plugin that relies on several JS scripts. In my plugin file (graph-plugin.php) I've the following function: function initialize_scripts() { wp_register_script( 'int-flot', ...
1
vote
2answers
15k views

Passing URL parameters to WordPress pages and pretty url

I create shortcode like this function test_func( $atts ) { return $_GET['myvar']; } add_shortcode( 'test', 'test_func' ); and one page with this name myparameters so this is the final url ...
0
votes
1answer
2k views

How to create session for user which is not an admin user

Hello I am working on building a plugin which has the following functionality like stated below My problem is I am stuck at point I have created registration form for the users where users will be ...
6
votes
1answer
5k views

How to stop showing admin notice after close button has been clicked

First of all I do know how to add admin notice in the wordpress admin menu. And I added an admin notice like this: <?php add_action( 'admin_notices', function() { ?> <div class="...
0
votes
1answer
26 views

Looking for a better way to initiate cron job

Is there any other good way to initiate an hourly cron job other than using register_activation_hook within a plugin? As looks like it will not be useful for websites that have already installed and ...
0
votes
1answer
20 views

How to extend SelectControl with data from my theme

I'm building a custom gutenberg block that should have a dropdown (SelectControl) to select which css class should be added to my block. So far, nothing special. My problem is that depending on the ...
0
votes
1answer
18 views

Translations for my plugin don't show up

I'm pulling my hair out with this one: I want to provide translations for my plugin, but they're not showing up. I followed the documentation and took the following steps: Set up local wordpress ...
0
votes
1answer
21 views

Remove Zero Money From Previews Order woocommerce

I have had many orders in the past that the currency is different and has 4 extra zeros. I want to remove these 4 zeros from them and change their currency together. please help me
0
votes
1answer
21 views

Use localized plugin name and description even when the plugin is disabled

I'm working on plugin development and I'd like to localize my plugin name and description, so that these two pieces of information are shown to other WordPress developers in their native languages (if ...
3
votes
1answer
731 views

How do I approach removing menu items on the fly based on settings in my plugin?

I've started writing a plugin that allows the administrator to select specific pages and set them to be visible only to logged-in users; the plugin optionally applies the restriction to all child ...
0
votes
0answers
18 views

How to change basename url for wp-admin?

I want to apply some conditions based on site url, e.g redirect login.php, default files etc If a uri is /wp-login.php we do use basename as written below $custom = basename($_SERVER['REQUEST_URI']); ...
0
votes
1answer
869 views

The plugin generated XXX characters of unexpected output...help?

I am working on a plugin that creates a custom post type and then creates a custom template file for the activated theme. The plugin is done editing. But I've received an error while uploading that ...
0
votes
1answer
19 views

Plugins and caching

So, I've been tinkering with a basic firewall plugin and today I stumbled upon a problem. Caching. I had forgotten that I had LightSpeed cache installed one one of my test sites and went to work on my ...
3
votes
2answers
714 views

Making plugin unique to not conflict with plugins with the same name

I have plugin that has the same name as other plugin uploaded to wordpress.org How can i make it unique so it doesn't share "View Detais" link and auto-update with other plugin uploaded to wordpress....
0
votes
1answer
19 views

Dequeue / Deregister script and replace it with a new plugin

I think I've read a dozen posts about dequeuing and deregistering scripts, but I haven't been able to make it work properly in my situation. My situation: The "uListing" plugins are part of ...

1
2 3 4 5
123