Posts Tagged ‘WordPress’

Start scheduled task with WP Cron more often

Sunday, February 5th, 2012

WordPress Cron

WordPress Cron

WordPress has very useful built-in feature – it could start tasks by schedule. Of course you remember that you can schedule post publication and it will be published at needed time automatically. Thanks to WordPress developers team, this functionality is not limited by WordPress core. You can schedule your task for execution Once, Hourly, Twice a day, Daily. WordPress has public API for that. Look on this WordPress Codex page for your reference. Beautiful! Wonderful! That’s what I really need! But…

But what to do if you need to execute your task more often, than default schedule intervals offered by WordPress? Can you manage WordPress scheduler to start your job every 5 minutes instead of ‘hourly’, ‘twicedaily’ and ‘daily’ intervals?

Read the rest of this entry

WordPress shows unpublished pages

Saturday, January 28th, 2012

Why WordPress shows unpublished pages

Publish with WordPress

I got questions from WordPress users how to change page status from ‘published’ to ‘pending for review’ automatically in case its author changed it. Its possible with little piece of code in your theme functions.php file and the same little user capabilities manipulation. You can look how it works on the video by this link or scrolling to the end of this post. So it seems, that problem is resolved. No. WordPress 2011 theme (and possibly others) is written such way, that page (with all changed content) is shown in any status, including ‘draft’. You just should know its link. Make little experiment. Create new page and save its draft. Then type in the browser URL to this page. Do you see it? Yes, me too.

How to change this WordPress behavior?
We need to update the ‘page.php’ template file from the 2011 (Twenty Eleven) theme package.

Read the rest of this entry

add_users WordPress user capability

Sunday, January 22nd, 2012

(image from hiren.info)

add_users capability

User capability “add_users” was added to the WordPress “Administrator” user role since WordPress version 3.0. But this capability is not used yet by WordPress itself in any form. Perhaps it was added for use in the future versions and could be use by themes and plugins developers of course. It does nothing in the WordPress 3.3.1. So you may skip it temporally in your WordPress capabilities system research.

The only place where you can find ‘add_users’ WordPress user capability in WordPress source code is
/wp-admin/includes/schema.php:

781
	$role->add_cap( 'add_users' );

User Role Editor WordPress plugin version 3.4

Saturday, January 21st, 2012

User Role Editor v. 3.4

User Role Editor v. 3.4

User Role Editor WordPress plugin v. 3.4 is published.
What’s new in this version? I got feature request from one user about ability to edit “Administrator” role. Sometimes plugins or themes add its own capabilities to other (may be its own) roles, not to administrator. Thus, you may meet with situation, when some user can do more, than blog admin. That’s not so good.
Starting from version 3.4. you can turn on missed user capabilities for Administrator role. This feature is turned off by default. In order to turn it on,
Read the rest of this entry

moderate_comments WordPress user capability

Friday, January 20th, 2012

moderate comments capability

moderate comments capability

Oficial WordPress Codex page says that “moderate_comments” WordPress user capability “allows users to moderate comments from the Comments SubPanel (although a user needs the edit_posts Capability in order to access this)”.

What I can say? Do not trust your own eyes. It is not the full true. Only last part of this declaration (about “edit_posts” capability) works as described in relation to the Comments subpanel. Are you not sure? Check it yourself. Take “User Role Editor” WordPress plugin, select the “Editor” role and uncheck “moderate_comments” capability. Then login to WordPress under the user with “Editor” role and go to the “Comments” panel. Do you still see links “unaprove, edit, spam, trash” under the comments there? Thus, you still may moderate comments inspite of you have not “moderate_comments” capability.
So, the next question – what is the real power of “moderate_comments” WordPress user capability?

Read the rest of this entry

WordPress 3.3.1 Security Update

Tuesday, January 3rd, 2012

WordPress version 3.3.1

WordPress version 3.3.1

WordPress 3.3.1 is available from January 3rd, 2012. Version 3.3.1 is a security update and fixed 15 bugs. While I didn’t meet any bugs in version 3.3 myself (and you?) I have updated my blogs as soon I got message about this security update (it fixes a cross-site scripting vulnerability that affected version 3.3) available. The same thing is highly recommended for other WordPress blog owners.
Do not wait when hackers exploit existing vulnerability, update your WordPress installation today, do not allow bad guys to use old and already closed black doors to your sweet WordPress blog home.

For more information, see the oficial release notes.

Show to author his posts comments only

Sunday, December 25th, 2011

http://socalohv.com/images/General/Moderator.jpg

See your posts comments only

When authors of your blog click ‘Comments’ menu item in WordPress backend, they see all comments by default, not only from theirs posts. Yes, it’s not possible to do something with such comments (any actions are blocked in case are not a post author) but what the sense to see on all this mess and search comments from your posts to moderate inside full comments list? I think you agree, there is a little sense, if nothing at all.
Do you wish to show for your authors comments from theirs posts only?
Read the rest of this entry