WordPress shows unpublished pages

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

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

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

January 20th, 2012

moderate_comments capability

moderate comments capability

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)”, – oficial WordPress Codex page says.

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 “unapprove, 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

Support stop SOPA-PIPA movement

January 19th, 2012

Stop censorship

Stop censorship

What amazing things are going! We are so different, large and small, thin and thick, young and old, we are so different, but all of us come together to stop SOPA-PIPA. No censorship in Internet! I got this email from fightforthefuture.org team and share it with you:
“Google launched a petition. Wikipedia voted to shut itself off. Senators’ websites went down just from the sheer surge of voters trying to write them. NYC and SF geeks had protests that packed city blocks.
You made history today: nothing like this has ever happened before. Tech companies and users teamed up. Tens of millions of people who make the internet what it is joined together to defend their freedoms. The free network defended itself. Whatever you call it, the bottom line is clear: from today forward, it will be much harder to mess up the internet.
The really crazy part? We might even win.
Approaching Monday’s crucial Senate vote there are now 35 Senators publicly opposing PIPA. Last week there were 5. And it just takes just 41 solid “no” votes to permanently stall PIPA (and SOPA) in the Senate. What seemed like miles away a few weeks ago is now within reach.
But don’t trust predictions. The forces behind SOPA & PIPA (mostly movie companies) can make small changes to these bills until they know they have the votes to pass. Members of Congress know SOPA & PIPA are unpopular, but they don’t understand why–so they’re easily duped by superficial changes.
The Senate returns next week, and the next few days are critical.

Read the rest of this entry

NetBeans IDE for PHP 7.1 available

January 5th, 2012

NetBeans IDE for PHP 7.1

NetBeans IDE for PHP 7.1

Today, January 5th, 2012 netbeans.org team announced, that NetBeans IDE 7.1 released. Congratulations!
I use NetBeans as my main integrated development environment to work with PHP. So, I downloaded it just got the notification email from netbeans.org. What is first impression? First impression is right the most of the time. On my Ubuntu 10.04 LTS installation was smooth and fast. After 1st start NetBeans as usual asked permission to import settings from the previous installation. Finally, it started and worked as it should. The main part – debugging with FireFox browser still works. So I can continue my Web development work under this version.
Small negative – I don’t know where the reason, but I caught the situation, when NetBeans editor window lost cursor focus.

Read the rest of this entry

WordPress 3.3.1 Security Update

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.