delete_themes WordPress user capability

March 19th, 2012

delete_themes WordPress user capability

delete_themes

What capability to add or remove in order to allow or prohibit WordPress theme deletion? That’s simple, you can say, of course delete_themes user capability. It is clear from its name, isn’t it? You are right. But it is not full true. It’s useful to know, that if you have not switch_themes capability under single-site WordPress installation, you can not delete selected theme, even if you click ‘Delete’ command from WordPress interface. Interesting? Continue reading and see more detailed description or (if you curious enough) even look inside WordPress core source code together with me.
I found delete_themes capability in this WordPress core files:
- wp-admin\themes.php;
- wp-admin\network\themes.php;
- wp-admin\includes\class-wp-ms-themes-list-table.php;
- wp-admin\includes\class-wp-themes-list-table.php;
- wp-includes\capabilities.php;
- wp-admin\includes\schema.php.
Read the rest of this entry

delete_plugins WordPress user capability

March 17th, 2012

delete_plugin WordPress user capability

Delete plugin

delete_plugins WordPress user capability allows user to delete not active plugins. Such user has to have access to the “Plugins” menu at WordPress administrator back-end (requires activate_plugins capability for that). In order to delete plugin user can use plugin row link, which is shown under each plugin name, or bulk action, applied to the selected set of plugins simultaneously.
delete_plugins capability is used inside these WordPress core files:
- wp-admin/plugins.php;
- wp-admin/includes/class-wp-plugins-list-table.php;
- wp-admin/includes/schema.php;
- wp-includes/capabilities.php;
Proceed reading if you wish to look inside WordPress core code and get more details.
Read the rest of this entry

Thank You Counter Button v. 1.8 is published

March 2nd, 2012

Thank You Counter Button v. 1.8

Thank You Counter Button v. 1.8

After long (about a year) silence period we get “Thank You Counter Button” WordPress plugin next version published. Version 1.8 is available now. What’s new in this version:
- CSS classes (thanks_quant_for_post, thanks_total_quant_label, thanks_total_quant_value) were added to sidebar widget. Use it to make your widget more attractive.
- Colon is removed from button caption. So add it manually to the button caption, if you need that.
- ShinePHP.com RSS feed box was removed from the plugin Settings page.
- Sidebar widget data could be filtered by category now. Just select needed category from the dropdown list at the widget configuration form.
- Thanks from custom post types are shown in the widgets now.
- TYCB plugin Settings form is updated (check your settings after version update, just in case they were changed suddenly ;) ).
- TYCB Statistics data tab is moved from Settings page to the separate menu item under Tools menu.
- Button image is changed slightly when you hover mouse on it.
More details about “Thank You Counter Button” WordPress plugin is available here.

User Role Editor 3.5 is published

February 19th, 2012

User Role Editor WordPress plugin version 3.5

User Role Editor v. 3.5

What’s new in version 3.5 of User Role Editor WordPress plugin?
- User Role Editor could be available now for single site administrators (Administrator role) under multi-site environment. You should define special constant in your blog wp-config.php file for that.
- One of “User Role Editor” users with 1100+ sites in the multi-site network reported that URE doesn’t update roles for all sites, but stalls somewhere in the middle. Other network update method is realized as alternative. Due to my tests it works approximately 30 times faster. If you met the same problem, try it. It will be great if you share your experience with me. But be careful. It’s recommended to make 1st try on the backup copy, not on a live site.
- Persian translation is updated.
Go to User Role Editor Change Log for details.

Block posting to selected categories

February 19th, 2012

Exclude category for role

Exclude category for role

Block posting to the list of selected categories on per role base – is it possible? If you wish to limit your WordPress blog authors or users with custom created role from posting to some categories only, you can do it with piece of PHP code below (read entire post to get it.).

Just copy it and paste it into your active theme functions.php file (wp-content/themes/your-theme/functions.php) insert ID of categories to block. You can get ID of category at Categories page. Move mouse over ‘Edit’ link of selected category and look on the link at the bottom of your browser. Search ‘tag_ID=’ there. The number to the right of it is the category ID.
Congratulations! That’s all. You got it.

Read the rest of this entry

php curl sslv3 allert illegial parameter

February 17th, 2012

PHP Curl SSL Version

PHP Curl SSL Version

Working with one site via PHP CURL library recently, I met strange error. Site returned nothing to my CURL request from PHP code, but worked fine for the same URL via browser. What the mysticism was happened there? I started my research.

1st, I found CURLOPT_VERBOSE parameter. If you can not guess what is wrong with your CURL request, turn on CURLOPT_VERBOSE parameter. It’s very useful in such situation:

curl_setopt($ch, CURLOPT_VERBOSE, true);

Setting its value to TRUE forces CURL to output verbose information. It writes output to STDERR, or the file specified using CURLOPT_STDERR.
So I added parameter above and made step forward at once. I got the reason, why my CURL request didn’t work. CURL returned this information in the verbose mode:

Read the rest of this entry

delete posts and pages WordPress user capabilities set

February 12th, 2012

Delete posts and pages capabilities

Delete posts and pages capabilities

Delete posts and pages. Who can make these critical operation at your blog? It is worth a lot of efforts to build good content for your blog. But some time we delete old and unneeded posts or pages. Whom WordPress allows to make that? What capabilities user should have to be powerful enough, in order reduce you site content?

If you read WordPress Codex “Roles and Capabilities” page or use plugin like User Role Editor to manage WordPress roles and user capabilities, you saw there this capabilities set, in alphabetical order:
delete_others_pages, delete_others_posts, delete_pages, delete_posts, delete_private_pages, delete_private_posts, delete_published_pages, delete_published_posts.

While these capabilities names are self-explained, it’s interesting, how and where WordPress checks them.

Read the rest of this entry