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

Vulnerability in AJAX Comments Plugin

Searching the internet I found a plugin that allows any WordPress site user to comment on posts without having to log in. You install the plugin and add the shortcode to the post. After that, any user ...
0
votes
3answers
9 views

Hide custom post type by user roles

I created a custom post type ( Customers ) and i want to show posts of this post type just to the users with Customer role. there is any way without or with plugin?
1
vote
1answer
22 views

How to run a bash script from a plugin?

I am lookin for some guidance. I have a host command that has to be runned between two functions in a plug-in I am working on. Long story short, I have built a class which holds two methods, namely: ...
0
votes
1answer
2k views

PHP calling function within a class

I'm writing my own php class and I have multiple functions within the class. Something like this: class JSON_API_Hello_Controller { public function test_cat(){ global $json_api; ...
0
votes
1answer
2k views

How can we upload file to root directory of wordpress

I'm working on wordpress project, Theme have some demos i've added add_menu_page where all of the demos stored e.g pictures and names, I know the REST-API where i've added condition if theme license ...
0
votes
1answer
2k views

ajax multiple Values

i tryed to return multiple Values from an Ajax Call, I would Like to retun Value a and value b in two separat Variables in my Ajax function. Is it posible to do that? or could I use an Array? Or ...
0
votes
0answers
10 views

How to implement color picker from WordPress in my boilerplate plugin?

I have seen this reply before: How to implement color picker from wordpress in my plugin? But I personally still don't quite understand how I can add it in my plugin that follows the boilerplate ...
0
votes
1answer
35 views

Why are custom taxonomies only appearing on the edit page of one of these types, but not the other?

So here's an odd one. I have custom taxonomies that show on the admin menu of both post types they're associated with, but only one of the post types shows them in its edit menu. (Over on the side of ...
0
votes
2answers
569 views

Glyphicons Dont Show in WordPress Plugin Only

I have a very simple WordPress plugin that shows a menu/admin page. The page contains Glyphicons - Font Awesome. These glyphicons are never showing. I cannot figure out why because I know the font-...
0
votes
1answer
38 views

Can't print Yoast meta description into page template (syntax error, unexpected '.')

Here is the relevant portion of my page template code: $yoast_meta = get_post_meta($post->ID, '_yoast_wpseo_metadesc', true); function my_service_template_footer_data() { echo "<script ...
2
votes
1answer
2k views

update_option is not working!

I am writing a plugin and I need to use the update_option function to update an array I have stored as an option in WP. For the admin panel I used the settings API but for this portion I need to use ...
0
votes
0answers
17 views

How to create a single admin_notice that can be dismissed (and stays gone)?

I found this tutorial thinking it might do the trick. So I created the following files and placed in a /notice/ subfolder of the plugin: dismissable.php update-notice.php update-option.php /js/...
1
vote
2answers
15 views

Using a post-signup hook to get user details

Update: I got this working with a different hook user_register. It looks like wpmu_activate_user was never triggering. I would still like to have this happen after the user verifies and sets a ...
0
votes
1answer
13 views

Using ACF default value to autoincrement a number field

I am trying to create a field called "numero" as an auto increment field with advanced custom fields. This function with WP_Query returns the last inserted "numero". function ...
0
votes
1answer
631 views

wp-load.php redeclares classes

I am trying to load WordPress options within a standalone PHP file. The file is located in /wp-content/plugins/plugin-name/file.php. I have used the following to open wp-load.php: if (file_exists('../...
0
votes
1answer
16 views

How does update method in Widget class saves $instance array from Select tag?

Following a tutorial and it works fine. I just can't understand how update method saves $instance array in the database from Select tag? You can choose default or full, slick save in the admin area ...
0
votes
0answers
69 views

Only the first image uploads

I am trying to upload these two images to my site: https://listing-images.homejunction.com/maris/82721628/photo_1.jpg https://listing-images.homejunction.com/maris/82721628/photo_2.jpg But only the ...
0
votes
2answers
504 views

Storing values in Post Meta vs new tables

I want to store list of user IDs in the post meta who have rated a post . So, for each post I will need to check the post meta to see if the user id exists in it or not. So my question is that, is it ...
31
votes
6answers
25k views

Post meta vs separate database tables

When developing plugins that requires data storage, what's the pros and cons of using one method or another ? The explanation given in the codex is not detailed: Before jumping in with a whole new ...
1
vote
2answers
9k views

AJAX success response is not working but it's saving my changes

I'm a beginner in jQuery-Ajax so please bear with me. My Ajax response does not seem to load but my changes are being saved. but gives me this error on admin-ajax.php "call_user_func() expects ...
0
votes
0answers
13 views

How can I add Google autocomplete field in quick edit section for a custom taxonomy? [closed]

I have a custom taxonomy and the screenshot https://nimb.ws/4VK9gF is specified where I added the custom field Address. So now I want to this textbox works as a google map autocomplete field. In this ...
0
votes
0answers
22 views

Adding the picture as a download [woo]

I'm looking for a hook, corresponding to event "creation of product" to make able set the download from product image to already set downloadable product. To the moment my plugin is ...
0
votes
1answer
615 views

CPT UI and custom database table

I am new in wordpress dev. I am building a plugin and I have a question I have a custom table in the database Is there any way to create a Custom Post type connected to this table? I am using CPT ui ...
0
votes
0answers
18 views

Add action wp_footer in define_public_hooks for plugin development [closed]

I'm trying to add some code that creates a cookie banner for my plugin after the footer. This is the code I use inside the "define_public_hooks" function in the PHP classes file inside the &...
0
votes
0answers
21 views

Using sessions or an alternative in a plugin

I want to use sessions in a plugin, I use this code in my plugin to start a session add_action('init','register_session',1); function register_session(){ global $cons; if (session_status() === ...
0
votes
2answers
600 views

Only admin should run wordpress plugin shortcode

I have created a simple plugin that locks down content for users not logged in and it is working fine. However any user on a multi-author site could use the same short code in his post to lock down ...
0
votes
0answers
33 views

Is there a way to get rendered html content of a WP post after updating?

I tried adding a filter at the content etc but that one just gives access to content stored in wp_posts. I am interested in getting the rendered html with meta tags etc for a post, after it is updated....
1
vote
2answers
594 views

TinyMCE Styles Dropdown not adding html tags other than span

I am trying to add h1,h2 .. in the TinyMCE Styles Dropdown with my other html elements. I have tried the following code, but the problem is it only adds styles if I use span as 'block' value. If I ...
3
votes
2answers
627 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
31 views

Conditional query tags do not work before the query is run. Before then, they always return false

I'm coding a plugin. When it's loaded I check is_single() which returns the following error: _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then,...
1
vote
1answer
18 views

Logout users upon login, based on caps/role?

To reduce spam registrations, users are assigned the pending role until they're vetted (at which point they're assigned the subscriber role). The pending role has no capabilities. When pending users ...
3
votes
2answers
334 views

Is there widely accepted phpDoc syntax for documenting which hook calls a function?

I keep all hooks in one file, and the functions are organized in their respective classes (different auto-loaded files). Looking for a standard way to document that a function's sole purpose is to be ...
2
votes
1answer
3k views

Integrating Stripe PHP library into a custom Wordpress Plugin

I am trying to create a simple 'add monthly Subscriptions(Monthly payments) button' custom plugin for a clients Wordpress website. My current issue is how am I to include Stripe's PHP library in the ...
0
votes
1answer
16 views

custom post type plugin error [closed]

I followed the following to set up a plugin for custom post types: https://kinsta.com/blog/wordpress-custom-post-types/#register But i am getting the error: Parse error: syntax error, unexpected '', $...
0
votes
1answer
15 views

Bypass product key [closed]

I have pro plugin from codecanyon with product key, which was used already. I couldn't use it in my new domain Is there a way how to bypass the product key via FTP ?
3
votes
2answers
727 views

Is there any background process that I can run from plugin without depending on page hits on a website without affecting page-load speed?

I am developing a WordPress plugin and wants to run a background task that calls an API and updates database table. Now, the API can only give results for 5 DB entries in one go and for 500 entries in ...
1
vote
1answer
2k views

Remove custom post type slug from URL and add taxonomy Slug

I am having an issue while changing a custom post type URL. Current post type URL is: http://example.com/product/product-slug where product is a custom post type. I want to change it to: http://...
0
votes
2answers
32 views

Wordpress publish_post hook not getting featured image and meta on first publish, but works on updating title

I've been struggling to find a solution for this and I don't know if it's the Gutenberg editor or if it's the hook publish_post. Hook: function api_method($post_id) { // If this is just a revision,...
0
votes
0answers
13 views

getting Sorry, you are not allowed to access this page when switching tabs

I'm working on plugin and created Top level admin menu with Settings sub menu.The Setting page has multiple tabs, [base options] [report options] etc. When I render the page for the first time, ...
0
votes
0answers
21 views

Get attribute for the selected variation - Woocommerce [closed]

I have a variable product with two attributes: condition and network. Both attributes have several items in them but I'm only interested in conditions for now: very good and good. I want to output ...
9
votes
5answers
15k views

How to validate custom fields in custom post type?

I wrote a plugin that creates a custom post type with custom fields. To prevent users from entering incorrect information, how can I validate the data? I assumed that the save_post hook function ...
0
votes
1answer
18 views

How do I fetch data from an external MSSQL database and show it on my wordpress site [closed]

I have taken a seemingly impossible project for a person of my skill-set and I am looking for as much guidance as possible. My new employer has a WP website where he has a custom post type and this ...
1
vote
0answers
2k views

Creating a Callback URL for Wordpress Woocommerce to update Order Status

I want to create a Callback URL to update the order status when data in JSON format is POST to it. Post Format Example: "hash": "43745580XXXXXXXXXXXXXXXXXXXXXX", "status_feed": [{ "order_id":...
0
votes
1answer
23 views

How to generate an all in one WordPress New content, plugin and theme update report on a website? [closed]

I am sure people must have tried this already but I am not able to find any good resources or guidance on how to create a complete report of a WordPress website weekly or monthly. A report that would ...
0
votes
2answers
12 views

Getting User email on logout. wp_logout

I have looked at a couple of different ways to check when a user, of a particular role, has logged out. The call is made within a plugin. In the main loop I have the following: add_action( 'wp_logout'...
0
votes
0answers
18 views

Activating child theme by “theme name”

I am developing a plugin where there is an option to install and activate the theme. Those are child themes and compatible with the parent themes. the problem is, the theme is installing correctly by ...
0
votes
1answer
604 views

WordPress Reset password Strength set to medium

I have been looking for an answer for a few days digging through hooks and actions. I just cane seem to find a way to turn down the strength on the reset password page not sure if its through woo-...
0
votes
1answer
1k views

get all products of one category

i use this function to get all products of one category in ajax request function get_products() { $cat_id = $_POST['category']; $args = array( 'post_type' => 'product', '...
0
votes
0answers
19 views

howTo let wordpress endpoint return html-page

i want let WordPress endpoint return a HTML-page. my plugin actually returns Howdy!! if i read web-browser at http://localhost/wordpress/wp-json/a0plugin/v1/testing i want get a HTML-page instead. my ...
0
votes
0answers
10 views

How to save image in uploads directory from custom plugin

in my plugin after a images elaborations I want to move this image in uploads folder. How I can do it? if (count($imagesCollectedIds) > 1 && $watermarkId) { $...

1
2 3 4 5
121