Changeset 512964
- Timestamp:
- 03/01/2012 02:36:51 PM (14 years ago)
- Location:
- secret-content
- Files:
-
- 3 added
- 3 edited
-
assets/banner-772x250.png (modified) (previous)
-
trunk/languages/secret-content.pot (added)
-
trunk/languages/secret_textdomain-da_DK.mo (added)
-
trunk/languages/secret_textdomain-da_DK.po (added)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/secret-content.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
secret-content/trunk/readme.txt
r512773 r512964 62 62 63 63 0.9 64 * First release in English only. 64 65 65 * First release 66 1.0 67 * In english, with Danish translation 66 68 69 70 == Upgrade Notice == 71 72 = 1.0 = 73 From initial 0.9 to 1.0 - Only added translation to da_DK - this is a worry free upgrade! -
secret-content/trunk/secret-content.php
r512773 r512964 5 5 Description: Adds metabox to posts/pages - Tick the checkbox to hide content from non logged in visitors. 6 6 Author: Emil Vang Arffmann 7 Version: 0.97 Version: 1.0 8 8 Author URI: http://oneconsult.dk 9 9 */ 10 10 11 // 0.9 initial release - mainly before "Generate POT file" from WP repository 12 // ... and allowing room for comments / improvements 11 // 1.0 - In english, with Danish translation 13 12 14 13 // TODO and considerations: 15 // add localization .pot .mo file for others to translate - awaiting first WP repo submit / "Generate POT file"16 14 // add overview/list of all secrified posts/pages, quick change to non secret 17 15 // add icon on post/page admin overview to indicate its for logged in members only. … … 240 238 241 239 242 // modify content, if the post is being called directly..243 // fixed the_posts removes the need for this?!?244 // add_action('wp', 'secret_tinker_direct');245 // optionally, fill post_content with "You need to be logged in to see this content"246 247 function secret_tinker_direct()248 {249 if ( !is_admin() )250 {251 if ( !is_user_logged_in() ) // if NOT logged in :)252 {253 global $wp_query;254 global $wpdb;255 $secrefied = $wpdb->get_col("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_secret_new_field' AND meta_value = 'on' ");256 257 // someone is trying to watch a post they shouldent -> redirect to frontpage258 if ( is_singular() && in_array( $wp_query->query['p'], $secrefied ) )259 {260 wp_redirect( get_bloginfo('wpurl') ); exit;261 }262 263 if ( is_singular() && in_array( $wp_query->query['page_id'], $secrefied ) )264 {265 wp_redirect( get_bloginfo('wpurl') ); exit;266 }267 }268 }269 }270 271 272 273 240 /* links ----------------------------------------------------------------------- 274 241 … … 299 266 fun with wp repository 300 267 http://wpdevel.wordpress.com/2011/12/21/been-giving-a-lot-of-thought-to-how/ 301 http://w ww.turbosquid.com/3d-models/3d-cartoon-sub/512326302 268 http://wp.smashingmagazine.com/2011/11/23/improve-wordpress-plugins-readme-txt/ 269 303 270 */ 304 271 ?>
Note: See TracChangeset
for help on using the changeset viewer.