Articles of plugin development

Best practice for Designing a Plugin with this scenario

I have a HTML page which I wanna use inside a WordPress website. But this page should be only available to users who logged-in and non logged-in users should be redirected to login page. Since I need to check user status a PHP page should do the job and if user is logged-in it returns […]

Get content and send to 3rd party

I’ve been asked to create a WordPress plugin that will basically show a button on the “edit” and the “new” pages of the admin panel which (when clicking the button) verify an API key (which you can set in the settings) and then send the post contents to a 3rd party. When the 3rd party […]

add_filter : Passing an array instead of the callback function?

I was just reading through BuddyPress code because I want to develop a custom plugin on top of it. I encountered was something very peculiar that I haven’t seen before and cannot seem to find any material on. The following code is from a protected function under a class named as BP_Legacy // Filter BuddyPress […]

Action Hook Inside WordPress Plugin Shortcode

I’m developing a WordPress plugin and I’m having trouble getting $_POST data using an action inside my shortcode. The form I’m parsing is on a page that I’ve added my shortcode to. Here’s what I’ve got: function wpd_post_parse() { $string = ‘wp hook: ‘ . var_dump($_POST) . “\r\n”; //$string = ‘wp hook: first name: ‘ […]

Gravity Forms Anchor only on Front Page?

I have a front page that is pretty long length-wise so I have enabled add_filter(“gform_confirmation_anchor”, create_function(“”,”return true;”)); in my functions.php file. This helps the Gravity Form return to form on validation or submission (which overrides the defaults which would normally just return you to the top of the page). I am looking for a way […]

Make plugin php file called directly aware of WordPress?

My plugin needs to make a POST request to another file within the plugin that will receive the request and store some of its data as a new post in wordpress. The idea is that different sites that use this plugin as admin will be able to ‘receive’ posts via this file that will handle […]

Replace first occurence of a word with link

i want to extend automatically the first occurence of a word in all of my WordPress Blog Posts with a link. I found a code (on this site here: , that should do the replace, but how can i extend that, so that only the first occurence is replaced? Thanks! Rene

How to remove menus items from Menu section from WordPress theme customizer

HI I have I need to Remove Menu Items From Menu Session from the wordpress Theme Customer Below is the Screen shots I have Try Many Thing but did’nt work just i need to remove Menu items from Menu function remove_unnessory_item_customizer($wp_customize) { $wp_customize->remove_section(“themes”); /// $wp_customize->remove_section(“available-menu-items”); // $wp_customize->remove_section(“content”); // $wp_customize->remove_panel(“nav_menus”); $wp_customize->remove_section( ‘static_front_page’ ); } add_action(‘customize_register’, ‘remove_unnessory_item_customizer’, […]

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: <body> /* do something */ <script type=”text/javascript” id=”widget-code”> /* widget pops up */ </script> <\body> What I want to do […]

Bulk update wordpress posts

Coders. I’m really new in WP Coding, I have zero knowledge, here we are. I created a plugin (actually found it, but I did some modifications) which update all my wp posts. Let’s show you the code, if ( ! class_exists( ‘MyPlugin_BulkUpdatePosts’ ) ) : class MyPlugin_BulkUpdatePosts { public function __construct() { register_activation_hook( __FILE__, array( […]