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
0 answers
29 views

Showing Home option in dropdown when there is no Home page exist

I am developing a plugin and in the admin side, I need to show a dropdown with options of all types of pages and posts etc. Its kind of a visibility option for a widget to be displayed on pages ...
iZeshan's user avatar
  • 101
0 votes
1 answer
500 views

WordPress Throwing Deprecated Errors on its own Files

My WordPress Website is throwing PHP Deprecated Errors on wp-include files. I am novice WordPress Developer working on my site. I am being flooded by these errors and extremely high CPU consumption on ...
Amit Bajar's user avatar
1 vote
1 answer
79 views

How to prepend a header section to all pages related to my Wordpress Plugin

I need to display custom block of php that contains a header with logo, buttons etc just below the wpadminbar ideally in the wpcontent div position as a relative element. The respective header needs ...
Ion T's user avatar
  • 15
-1 votes
2 answers
771 views

How to get locale within WP REST Request?

When sending requests to the WP REST API / custom WP REST endpoints, which is the way to go to retrieve the current locale; a universal way which always works? I'm confused by the many functions ...
DevelJoe's user avatar
  • 487
0 votes
0 answers
23 views

Plugin forms overwrite each other's options

I am creating my first WP plugin, where I have two forms. Both work correctly, but when I save the information from one, the information from the other disappears. I'd like to save all options in one ...
Rufi's user avatar
  • 1
0 votes
0 answers
20 views

Testing Plugin - Install plugin dependencies in testing enviroment

I have a problem with a unit test. My plugin depends on the Timber plugin for rendering a Twig template. But when I need to run the unit test with WordPress testing enviroment, I can't install ...
Lautaro's user avatar
1 vote
2 answers
133 views

add category id to option name when adding an option on edit_category

i am trying to add options with category specific names to all categories individually. I spent many hours on this and can't find a solution. This is my code: add_action( 'category_edit_form_fields', '...
gurky's user avatar
  • 13
0 votes
0 answers
30 views

wp_register_script - illegal string offset

I've noticed that in my plugin code there is something wrong. I'm getting an illegal string offset error in the dependency delcaration of the wp_register_script function ...
ICTDEV's user avatar
  • 113
0 votes
0 answers
33 views

Load style and script for custom post type metabox

I'm using this code to try loading some custom assets for a custom post type I have registered public function setup_theme_backend_assets($hook) { $screen = get_current_screen(); ...
ICTDEV's user avatar
  • 113
0 votes
1 answer
11 views

How do I add multiple custom menu Woo-commerce my account page?

How do I add multiple custom menu Woo-commerce my account page? this code works but how do i show content for each my custom menus? function pa_custom_endpoint() { foreach(pa_custom_endpoint_keys()...
Behzad's user avatar
  • 1
0 votes
1 answer
54 views

public custom posts not showing in my wordpress plugin

I am building a WordPress plugin and I want to show all publicly registered custom post types (by theme or other plugins) in my plugin. But it only shows post and page custom post types not other ...
user3722579's user avatar
1 vote
0 answers
43 views

Save translation file of third party plugin in a custom plugin?

I have a custom plugin that I install on a handful of client sites. All the client sites uses a third party premium plugin, and I have translated that plugin to another language and saved the ...
Torben's user avatar
  • 11
0 votes
0 answers
29 views

Permissions error when I use my plugin to delete comments in the front-end

I recently created a plugin for WordPress that allows you to delete comments from a front-end post, with an undo delete function and without having to reload the page each time (Ajax). However, when I ...
user avatar
0 votes
1 answer
159 views

React Plugin Settings Page Localization

I'm learning how to make plugins, and Thanks to Sally CJ managed to get translation working on the PHP files, and the Gutenberg Block... (If any need help on this check here ) But, I can't make it ...
Jorge's user avatar
  • 25
0 votes
0 answers
33 views

Plugin translations are not loaded from translate.wordpress.org

My plugin has 100% translations for few languages in translate.wordpress.org. I have set the correct text domain, slug, "requires at least version" as per documentation below. https://...
Aakash Chakravarthy's user avatar
0 votes
0 answers
31 views

wpdb->prepare creates random string for % character [duplicate]

I have a query like this, $query = "... user LIKE '%-guest-%' ..."; And when I implemented wpdb->prepare in my query, % characters replaced by random strings. I found solution to ...
doraemon's user avatar
  • 213
0 votes
0 answers
29 views

How to enable auto update for embedded plugins

I'm working on a plugin that will support my custom theme. I've embedded some commercial plugins like elementor free and pro elements, but I've noticed that I'm unable to let auto update them if ...
ICTDEV's user avatar
  • 113
1 vote
1 answer
49 views

Why is my activator class adding the files/running the actions I add?

I am using the WP Plugin Boilerplate to develop a plugin, but when I activate the plugin, the require files and actions I put inside the activate() function are not working. I have tested the class ...
JayDev95's user avatar
  • 169
1 vote
0 answers
42 views

upload image to wordpress media library failed for custom post type

image upload failed. I tried to upload gym logo as thumbnail image for gym post type. All the form elements are working. But image upload is not working. images are not appearing in WordPress media ...
Safayet hossain's user avatar
0 votes
0 answers
44 views

My activator class isn't running the code inside

I am using the WP Plugin Boilerplate and I am requiring files and admin notices within the activator class but my Kirki panel is not showing up in the customizer and the admin notice isn't appearing. ...
JayDev95's user avatar
  • 169
0 votes
0 answers
475 views

Calling get_header() with installed FSE theme

I'm working on a plugin that adds a custom WP rewrite rule using add_rewrite_rule() and I'm loading a custom template for that rule using template_include hook and passing the template path to that ...
Ahmad Wael's user avatar
0 votes
1 answer
488 views

WordPress REST API - Custom field not added to pages

I have this code in my wordpress plugin. I'm working on an vue powered headless theme and I need to get all the informations about pages using the rest API. I've registered with success a custom res ...
ICTDEV's user avatar
  • 113
0 votes
1 answer
136 views

Use inline callable for hooks and filters

I created a WordPress plugin and I've used inline callable function for some hooks and filters, like this: add_action( "init", function(){ // some codes } ); now I want to publish my ...
Hossein's user avatar
2 votes
1 answer
244 views

CPT template is not being automatically used single post pages

I created a plugin and added a custom post type to the plugin. I then created a template using the hierarchy single-{custom-post-type}.php. So my cpt slug is wppro-events and the single post template ...
JayDev95's user avatar
  • 169
0 votes
0 answers
106 views

Allow HTML in product attributes and variation for WooCommerce

I want to add TM to the name of attribute and a variation in woocommerce but it ended up a plain text. How can I do apply HTML there?
Shubham Bathla's user avatar
1 vote
2 answers
230 views

The Best Multilanguage Plugin supporting the FSE [closed]

Background I have been managing Wordpress sites (and multisite sites) for more than a decade and a half now, and for some reason this is the first time I really had to look into running WordPress in a ...
Peter's user avatar
  • 196
0 votes
1 answer
147 views

Error in using 'admin_enqueue_scripts' action through a class

I'm trying to separate plugin structure files by using the Best Practice method on wordpress org Best Practice. in plugins\plugin_name\public\index1.php there's the class for enqueue script <?php ...
Mostafa Ezzat's user avatar
0 votes
0 answers
28 views

claim a permalink and all sublinks in plugin

I've built some wp plugins so have some experience but definitely not an expert. I want to build a plugin that can claim a permalink and all sublinks of that permalink and return it to the plugin. ...
AutoBaker's user avatar
  • 151
0 votes
1 answer
77 views

REST API error in block editor for custom templates

I'm working on a plugin that adds custom templates to WordPress for use with the active theme. The template files are located in a plugin directory and are being passed into WordPress with the ...
Kylen's user avatar
  • 1
0 votes
0 answers
27 views

Reinitiate Gutenburg's blocks using javascript

I'm developing a WordPress plugin that manipulates some Gutenberg blocks using javascript. For better understanding, create a table in a post and run the code below in the console: let tableHtml = ...
Erfan Paslar's user avatar
0 votes
1 answer
35 views

Is it within WordPress guidelines to update another plugin's database fields from my own plugin? [closed]

Is it within the WordPress guidelines and acceptable practices to modify the database fields of another plugin, specifically the meta description fields, from my own plugin? I would like to check if ...
thatthing's user avatar
  • 101
0 votes
1 answer
27 views

Why is WordPress wrapping search for users that looks like integers with asterisks and how do I fix it?

I've got a custom meta field for users called "user_ein". It looks like an integer but is a string of number and it can start with the number "0". I have the following code in a ...
StevieD's user avatar
  • 211
0 votes
1 answer
22 views

How do I modify the error code array used by "shake_error_codes" filter?

I have a plugin with a registration_errors filter to prevent users from using a .gov email address. I have this code in the "registration_errors" filter function: $errors->add( 'gov_email'...
StevieD's user avatar
  • 211
3 votes
1 answer
181 views

A better way of getting draft posts that has a particular post meta using get_posts function

I'm developing a simple WordPress plugin as part of my WordPress learning. It's about bulk post approval. The full plugin code is given in this question: Bulk post approval and publishing doesn't ...
Karma's user avatar
  • 176
1 vote
1 answer
140 views

How to make content as required in custom post type?

I created custom post type Testimonials and made the title required using the code in this link: Require title for pages Now I applied the code in order to make the content required, and it works fine....
Hatem Frere's user avatar
3 votes
1 answer
146 views

Redirect posts to post editor page based on query string

I want the posts that has the param edit to open the respective post editor page. This is because the admin bar is disabled on my site. So I need to make things easier to edit on my sites. I made the ...
Emmanuel Borges's user avatar
0 votes
0 answers
10 views

Fetch Custom Woocomerce filed data and check the data avialble in Wp-user table as nicname or username using function.php

I write a code for add custom filed in checkout form as add affiliate code I want to match that custom field data with username. If custom field data match with any of the username the chcekout ...
Kunal Verma's user avatar
0 votes
2 answers
267 views

Programmatically creating posts based on external JSON feed (asynchronously)

I am currently trying to create a Wordpress plugin which create posts in the Wordpress database based on data from an external JSON API. As an example this NewsAPI feed could be used: https://newsapi....
Joachim's user avatar
  • 21
5 votes
1 answer
166 views

Bulk post approval and publishing doesn't work

I'm new to WordPress plugin development. I'm trying to develop a simple plugin that creates a sub-menu named Approval under Posts menu and checks if any draft post has the post meta approve set to ...
Karma's user avatar
  • 176
0 votes
2 answers
479 views

External api call using wordpress

I want to start a new website and chose wordpress as my cmd, but im having a restriction. The website is all about api request to other websites and i triedto get an api to test it as an example. ...
Taofeeq Tajudeen 's user avatar
2 votes
1 answer
113 views

How do I display and edit other posts within the 'Edit Post' area of Wp-Admin Dashboard

I'm wondering how to edit the 'New Post/Edit Post' area of Wordpress. I want to create a new 'Screen Element' like the plugins do. I want this area to display all posts with a corresponding taxonomy ...
DJZEEGLER's user avatar
  • 119
3 votes
1 answer
143 views

How to add a simple design in classic editor plugin creating post page through another Wp plugin

I want to add simple html form without breaking the extisiting design or license of Classic Editor plugin which is GPLv2 I added simple code in classic-edior.php file (I'm not sure If it's the best ...
Steve's user avatar
  • 37
1 vote
0 answers
45 views

What's wrong in the WordPress Meta Box Generator code?

I am very new to WordPress development. When I submitted my plugin for review, it was rejected because ## Generic function/class/define/namespace names. I don't understand how to fix it. The review ...
Sumanta Dhank's user avatar
0 votes
0 answers
25 views

How to be Variables and options must be escaped when echo'd?

When I submitted my plugin for review it was rejected because "Variables and options must be escaped when echo'd". How do i escape the following 2 blocks of code? I am very new to wordpress ...
Sumanta Dhank's user avatar
2 votes
2 answers
29 views

Plugin submission denied for "Calling file locations poorly" when using WP_PLUGIN_DIR constant

I've submitted a plugin for review and it was not accepted for the following reason: Calling file locations poorly The way your plugin is referencing other files is not going to work with all setups ...
slanginbits's user avatar
0 votes
0 answers
35 views

WordPress plugin options page not saving options, no errors

My plugin's options page has two string options: username and access_key. When I enter my username and click "Save Changes", the page reloads, but the username is not present in the option ...
Steve's user avatar
  • 1,677
0 votes
1 answer
52 views

I'm getting the following error: Fatal error: Uncaught Error: Call to undefined function oil_paint_regeneration() [closed]

This is for a WordPress plugin that automatically regenerates and applies oil painting effect to featured images attached to a post published by user_id=1 to user_id=5, 3-5 minutes after the post has ...
commerceless's user avatar
0 votes
0 answers
44 views

How to check record is exist or not in WordPress CRUD Operation with $wpdb

I have been trying to custom CRUD Operation for in Wordpress Page Template, Where i need to handle CRUD Operation but I need to I need to check whether record is exist or not before Insertion. Here is ...
Bhargav Joshi's user avatar
0 votes
0 answers
27 views

Set link dialog to open in blank by default

I'm trying to find a way to set the link option to open in a new window by default. I found this clever plugin but it is outdated. https://github.com/whyisjake/new-tab-always/blob/master/new-tab-...
Josh408's user avatar
  • 11
0 votes
1 answer
65 views

filter on get_posts efficiently

I have posts with the following categories: A category that is a year(2017,2018...2022), a category that is type:(worldwide,Europe, local) I am trying to give users in the frontend advanced search ...
user206904's user avatar

1
3 4
5
6 7
133