Title: Lock Pages
Author: Steve Taylor
Published: <strong>Bélú 8, 2009</strong>
Last modified: Ọ̀pẹ  19, 2018

---

Ṣàwárí àwọn plugin

Plugin yìí **kò tíì ṣe àyẹ̀wò pẹ̀lú àwọn ìtújáde mẹ́ta pàtàkì tó kẹ́yìn ti WordPress**.
Ó lè jẹ́ pé a kò tọ́jú tàbí ṣe àtìlẹ́yìn fún un mọ́, ó sì lè ní àwọn ọ̀ràn ìbámu
nígbà tí a bá lò ó pẹ̀lú àwọn ẹ̀yà WordPress tuntun.

![](https://s.w.org/plugins/geopattern-icon/lock-pages.svg)

# Lock Pages

 Láti ọwọ́ [Steve Taylor](https://profiles.wordpress.org/gyrus/)

[Ṣe ìgbàsílẹ̀](https://downloads.wordpress.org/plugin/lock-pages.0.3.1.zip)

 * [Àwọn àlàyé](https://yor.wordpress.org/plugins/lock-pages/#description)
 * [Àwọn àgbéyẹ̀wò](https://yor.wordpress.org/plugins/lock-pages/#reviews)
 *  [Ìgbéwọlẹ̀](https://yor.wordpress.org/plugins/lock-pages/#installation)
 * [Ìdàgbàsókè](https://yor.wordpress.org/plugins/lock-pages/#developers)

 [Ìrànlọ́wọ́](https://wordpress.org/support/plugin/lock-pages/)

## Àpèjúwe

NOTE: This plugin is not tested with Gutenberg, and we have no near-term plans to
do so. If using WP > 5.0, use the Classic Editor if there are problems.

NOTE: This plugin was originally designed to only lock pages, and only later added
custom post type functionality. Hence the name, and sometimes the terminology will
say “pages” when it means “any post type”.

Sometimes some pages or other posts are too important to allow them to be casually
moved about or deleted by site editors. An editor may think nothing of renaming 
a pageÌtumọ̀ Yorùbá: ’s slug, or deleting a page to replace it with something similar,
perhaps unaware of effects on SEO. Also, certain pages might be essential to keep
in place because of a siteÌtumọ̀ Yorùbá: ’s structure, or because of aspects of 
a custom theme.

This plugin lets administrators “lock” any or all pages, and any post of any post
type. “Locking” here basically means preventing non-admins from:

 * Editing the itemÌtumọ̀ Yorùbá: ’s slug
 * Changing the itemÌtumọ̀ Yorùbá: ’s parent
 * Changing the itemÌtumọ̀ Yorùbá: ’s template
 * Deleting the item
 * Changing the itemÌtumọ̀ Yorùbá: ’s status
 * Changing the itemÌtumọ̀ Yorùbá: ’s password protection

Locking is implemented by preventing the actual database update being performed 
as well as, where possible, having the interface element for that field removed.
Where possible interface elements are removed via WP filters on the server; otherwise,
jQuery is used on the client.

NOTE: Currently, IÌtumọ̀ Yorùbá: ’ve been unable to get this working with the Quick
Edit functionality. As a stop-gap measure, which is only in place because it seems
to be better than nothing, the Quick Edit link is removed for users who canÌtumọ̀
Yorùbá: ’t edit locked pages. I know, itÌtumọ̀ Yorùbá: ’s not great. But until I
work out how to selectively block Quick Editing, IÌtumọ̀ Yorùbá: ’m assuming a locked
page should be locked. Users can always edit the other fields via the normal edit
page.

Go to GitHub for [development code](https://github.com/gyrus/Lock-Pages) and [issue tracking](https://github.com/gyrus/Lock-Pages/issues).

### Known issues

 * Quick Edit presents problems. IÌtumọ̀ Yorùbá: ’ve worked out how to create hidden
   fields in the Quick Edit box, and to put the values in the hidden div, but I 
   canÌtumọ̀ Yorùbá: ’t work out how to dynamically populate the fields with the
   values, so the old values can be used if necessary on saving. For now Quick Edit
   is blocked for users who canÌtumọ̀ Yorùbá: ’t edit locked pages.
 * Although IÌtumọ̀ Yorùbá: ’ve fixed the lock_parent function so it allows uploaded
   files to be attached to a locked page, it still prevents media already in the
   library from being attached when inserted.

### Ideas

 * Include the locking checkbox for admins in the Quick Edit form.
 * On the settings screen, use a drop-down for selecting which capability is needed
   for editing locked page elements.
 * Implement a system to deal with descendants, e.g. an option to lock all descendants
   of a locked page or not.

## Àwọn àwòrán ìbòjú

[⌊The Lock Pages settings screen⌉⌊The Lock Pages settings screen⌉[

The Lock Pages settings screen

[⌊The meta box on the post edit screen that lets you lock a specific item⌉⌊The meta
box on the post edit screen that lets you lock a specific item⌉[

The meta box on the post edit screen that lets you lock a specific item

[⌊If a user can edit an item, but can't override its lock, they'll get this notice
letting them know⌉⌊If a user can edit an item, but can't override its lock, they'll
get this notice letting them know⌉[

If a user can edit an item, but canÌtumọ̀ Yorùbá: ’t override its lock, theyÌtumọ̀
Yorùbá: ’ll get this notice letting them know

[⌊The posts list will show which ones are currently locked⌉⌊The posts list will 
show which ones are currently locked⌉[

The posts list will show which ones are currently locked

## Ìgbéwọlẹ̀

ItÌtumọ̀ Yorùbá: ’s easiest to use the built-in plugin installer inside WordPress.
Go to _Plugins > Add New_, and search for “lock pages”.

To install manually:

 1. Upload the `lock-pages` folder into your siteÌtumọ̀ Yorùbá: ’s `/wp-content/plugins/`
    folder.
 2. Go to the list of installed _Plugins_ in WordPress and activate it.
 3. Go to _Settings > Lock Pages_ and change configuration if necessary.

ThatÌtumọ̀ Yorùbá: ’s it!

## FAQ

  Who can move, delete, etc. a page once itÌtumọ̀ Yorùbá: ’s locked?

The definition of who is able to move or delete locked pages is made via a plugin
setting that specifies a [capability](https://codex.wordpress.org/Roles_and_Capabilities).
This also defines who can edit the pluginÌtumọ̀ Yorùbá: ’s settings, and who can
lock individual pages. Be careful not to bar yourself!

It defaults to `manage_options`, which by default is only granted to the Administrator
role, but it can be changed. You will get a warning if you enter a capability that
doesnÌtumọ̀ Yorùbá: ’t exist in your system.

Lock Pages will work with Justin TadlockÌtumọ̀ Yorùbá: ’s [Members](https://wordpress.org/extend/plugins/members/)
plugin, if itÌtumọ̀ Yorùbá: ’s installed, to respect any custom capabilities you
may have entered.

  Does the locking work with Quick Edit as well?

No. IÌtumọ̀ Yorùbá: ’m having problems getting this working properly. Until then,
sadly, IÌtumọ̀ Yorùbá: ’ve had to remove the Quick Edit link from locked pages for
users who are barred from changing locked page attributes. Sorry! They can still
edit other things with the normal edit screen.

  WhatÌtumọ̀ Yorùbá: ’s the donate link about?

I feel I gain more than enough already from the WordPress community in monetary 
terms, through the work it lets me do and the services it lets me offer. For me,
part of writing a plugin is precisely to give back to the community Ìtumọ̀ Yorùbá:–
so it seems odd to ask for money for a small plugin (even if itÌtumọ̀ Yorùbá: ’s
not obligatory).

Still, I know that sometimes a plugin really makes your day and you want to give
back in turn. If this plugin tickles you and you feel like giving, IÌtumọ̀ Yorùbá:’
ve given the link to donate to Corporate Watch, who perform what I think is a hugely
important role in holding large corporations to account.

Of course, contributing back to the WordPress community is also a great way to express
gratitude for a plugin!

## Àwọn àgbéyẹ̀wò

Kò sí àwọn àgbéyẹ̀wò fún plugin yìí.

## Àwọn Olùkópa & Olùgbéejáde

“Lock Pages” jẹ́ ètò ìṣàmúlò orísun ṣíṣí sílẹ̀. Àwọn ènìyàn wọ̀nyí ti ṣe ìkópa sí
plugin yìí.

Àwọn Olùkópa

 *   [ Steve Taylor ](https://profiles.wordpress.org/gyrus/)

[Túmọ̀ “Lock Pages” sí èdè rẹ.](https://translate.wordpress.org/projects/wp-plugins/lock-pages)

### Ṣe o nífẹ̀ẹ́ sí ìdàgbàsókè?

[Ṣàwárí koodu](https://plugins.trac.wordpress.org/browser/lock-pages/), ṣàyẹ̀wò 
[ibi ìpamọ́ SVN](https://plugins.svn.wordpress.org/lock-pages/), tàbí ṣe àgbékalẹ̀
sí [àkọsílẹ̀ ìdàgbàsókè](https://plugins.trac.wordpress.org/log/lock-pages/) nípasẹ̀
[RSS](https://plugins.trac.wordpress.org/log/lock-pages/?limit=100&mode=stop_on_copy&format=rss).

## Àkọsílẹ̀ àwọn àyípadà

#### 0.3.1 (2018-12-18)

 * Added ‘protect from all’ option, to allow lock protection to apply even if user
   has capability to lock posts
 * Added proper defaulting for updates, to include new option defaults (thanks Kevin
   VandeKrol!)
 * Fixed issue with 4th parameter for `user_has_caps` filter, and issue with arrays
   passed for `$args[0]`
 * Fixed minor PHP errors

#### 0.3 (2015-08-19)

 * Added locking of posts and custom post types
 * Changed PNG lock icon to dashicon
 * Changed admin headings to H1

#### 0.2.4

 * Changed the way the parent drop-down is removed to prevent inteference with other
   uses of `wp_dropdown_pages`

#### 0.2.3

 * Removed PHP 4 constructor

#### 0.2.2

 * Added locking of page template

#### 0.2.1

 * Fixed clash with Simple Page Ordering plugin

#### 0.2

 * Updated check for page edit screen for WP 3
 * Improved removal of Quick Edit functionality
 * Removed edit permalink elements, slug meta box, parent drop-down, status and 
   password fields for locked pages
 * Changed initialization to use admin_init
 * Improved refusal of delete capability for locked pages
 * Added locking for page status and password protection
 * Added JavaScript and changed inclusion of CSS to use wp_enqueue_style
 * Created POT file for translations
 * Added Spanish translations (thanks to Javier Gómez Pose!)
 * Many coding style improvements
 * Removed unused properties `$thispluginurl` and `$thispluginpath`, introduced 
   use of `plugins_url`
 * Fixed handling of `$args` in `lock_deletion` to account for different `user_has_caps`
   contexts
 * Improved form security with esc_attr

#### 0.1.6

 * Refined check in lockParent so now uploads stay attached to a page even if you
   edit the attachment details after uploading.

#### 0.1.5

 * Added (hopefully temporary) blocking of Quick Edit functionality on pages that
   are locked for user who canÌtumọ̀ Yorùbá: ’t edit locked page elements.

#### 0.1.4

 * Added a check in lockParent to make sure itÌtumọ̀ Yorùbá: ’s not handling a file
   upload. Without this, the lock was preventing files being attached to a locked
   page.

#### 0.1.3

 * Added an important check in saveMeta function to make sure that a page (not a
   post, revision or autoupdate) is being saved. See http://alexking.org/blog/2008/
   09/06/wordpress-26x-duplicate-custom-field-issue

#### 0.1.2

 * Added prevention of deletion of locked pages.
 * Added “Lock” column and icon on Edit Pages list.
 * Streamlined permission checking.

#### 0.1.1

 * Fixed New Page meta box so the page lock checkbox is unchecked by default.
 * Changed ‘capability’ parameter for `add_options_page()` to match the capability
   setting in the plugin, i.e. only users with the capability to edit “locked” pages
   can change the plugin settings.

#### 0.1

 * First release.

## Àkójọpọ̀ Meta

 *  Ẹ̀yà **0.3.1**
 *  Ìgbàgbọ́hùn tó kẹ́yìn **ọdún 8 sẹ́yìn**
 *  Àwọn ìgbéwọlẹ̀ tó ṣiṣẹ́ **300+**
 *  Ẹ̀yà WordPress ** 3.0 tàbí ju bẹ́ẹ̀ lọ **
 *  Dánwò dé **4.9.29**
 *  Èdè
 * [English (US)](https://wordpress.org/plugins/lock-pages/)
 * Àwọn àmì
 * [admin](https://yor.wordpress.org/plugins/tags/admin/)[administration](https://yor.wordpress.org/plugins/tags/administration/)
   [cms](https://yor.wordpress.org/plugins/tags/cms/)[page](https://yor.wordpress.org/plugins/tags/page/)
   [pages](https://yor.wordpress.org/plugins/tags/pages/)
 *  [Ìwòye Tó Péye](https://yor.wordpress.org/plugins/lock-pages/advanced/)

## Àwọn ìbò

 4 lára àwọn ìràwọ̀ 5.

 *  [  1 5-star review     ](https://wordpress.org/support/plugin/lock-pages/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/lock-pages/reviews/?filter=4)
 *  [  1 3-star review     ](https://wordpress.org/support/plugin/lock-pages/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/lock-pages/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/lock-pages/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/lock-pages/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/lock-pages/reviews/)

## Àwọn Olùkópa

 *   [ Steve Taylor ](https://profiles.wordpress.org/gyrus/)

## Ìrànlọ́wọ́

Nǹkan wà tí o fẹ́ sọ? Ṣé o nílò ìrànlọ́wọ́?

 [Wo àpéjọ ìrànlọ́wọ́](https://wordpress.org/support/plugin/lock-pages/)

## Ṣe ìtọrẹ

Ṣé o fẹ́ ṣe àtìlẹ́yìn fún ìlọsíwájú plugin yìí?

 [ Ṣe ìtọrẹ sí plugin yìí ](http://www.babyloniantimes.co.uk/index.php?page=donate)