Articles of plugins

Keep user’s privileges on accessing contents in JSON response

I use WordPress REST API plugin to fetch WordPress stuff on a mobile app. What Access manager plugin keeps the privileges on REST API responses? I want restrict access to certain posts, categories etc for a particular role, So when the user of that role authenticates via HTTP request, could not access to that post. […]

Custom plugin settings: clicking “save changes” does not display success message

I don’t entirely understanding how to save my plugin’s settings properly. When I click on the “Save Changes” button it saves data but it does not show any successful like message. Do I need to add an extra function or something else? My form look like this: function bdthemes_core_settings_page() { ?> <div class=”wrap”> <h1>BdThemes Settings</h1> […]

Can I load the textdomain before a plugin is activated?

I’m writing a plugin and I’ve just added a check for a minimum PHP version. I tried to i18n the error message but it doesn’t work. I translated every string in the plugin, everything works correctly except that one, so the error is always displayed in english. Here’s my code: /** * Plugin Name: plugintest […]

Git Hosting for WordPress SVN Plugin Repository

I’m setting up my first WordPress plugin on the WordPress.org Plugin Site. Behind the scenes, developers add plugins to this site via an SVN repository. Is the any tooling (supported by Automattic and/or third party) that would allow me to seamlessly manage this svn repository via git and/or GitHub? i.e. I’d like my “source of […]

After upgrade to php 7 plugin/them updates broke

I upgraded my Ubuntu server to php 7 and setup ssh2. Afterwards, my WordPress plugins/themes will not update. I am receiving the Unable to locate WordPress Content directory (wp-content). This feature worked fine prior using php 5. My permissions were not changed and remain 755 (folders) 644 (files). I am using the same ssh user […]

Add a do_action to post_content of wp_insert_post

I created a plugin that is supposed to create a page with a contact form.. I got it to the point where it creates a page on activation of plugin, but I don’t know how to give the post_content a do_action.. Here is my create page function function ap_post_creation() { global $wpdb; $user_id = get_current_user_id(); […]

Change Page's <title> Tag Using functions.php File

In my child theme’s functions.php file, I’m trying to change a page’s title tag: function custom_title() { return “Page Title”; } add_filter( ‘wp_head’, ‘custom_title’, 9999 ); The code above is not changing the page’s default title. What am I doing wrong?

Advanced AJAX Page Loader ignores other JS code

I’m currently working on a WordPress site for a start-up music-studio. On the site the user has the possibility to listen to some of the artists tracks in a built in music player. This player will continue to play the music track as the user is navigation through the site. In order to make this […]

Passing Page ID used in Meta Box Creation to JavaScript

I have a bit of a unique situation that I haven’t been able to find while Googling. Essentially I am creating a plugin and I created a meta box with the following code (this is the callback function): // Callback function (creates meta box) function perPageMeta($post) { echo ‘Last Modified: ‘ . ‘<strong>’ . $post->post_modified […]

disable active plugins for specific theme

I want to disable some plugins from a specific theme.I am using deactivate_plugins hook to deactivate. following is my code. add_action(‘wp_head’,’disable_plugins’); function disable_plugins(){ include_once(ABSPATH.’wp-admin/includes/plugin.php’); $current_theme = wp_get_theme(); $current_theme_name = $current_theme->Name; if($current_theme_name == ‘Twenty Sixteen’){ if ( is_plugin_active(‘press-release/init.php’) ) { deactivate_plugins(‘press-release/init.php’); } } } This code deactivate plugins at wp_head hook but issue is I want […]