Changeset 1848493
- Timestamp:
- 03/28/2018 12:30:05 PM (8 years ago)
- Location:
- theme-blvd-layouts-to-posts/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
tb-layouts-to-posts.php (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
theme-blvd-layouts-to-posts/trunk/readme.txt
r1165432 r1848493 3 3 Contributors: themeblvd 4 4 Tags: layout builder, builder, custom layouts, themeblvd, theme blvd, jason bobich 5 Stable Tag: 1.0.4 5 Stable Tag: 1.0.5 6 Tested up to: 4.9 6 7 7 8 This plugin extends the Theme Blvd Layout Builder so you can assign your custom templates to standard posts and custom post types. … … 35 36 == Changelog == 36 37 38 = 1.0.5 - 03/28/2018 = 39 40 * Fixed: Password-protected posts display custom layout before password is entered (for Theme Blvd framework 2.7+ themes). 41 * Fixed: Styling of meta box was a bit wonky (for Theme Blvd framework 2.7+ themes). 42 37 43 = 1.0.4 - 05/21/2015 = 38 44 -
theme-blvd-layouts-to-posts/trunk/tb-layouts-to-posts.php
r1165432 r1848493 3 3 Plugin Name: Theme Blvd Layouts to Posts 4 4 Description: This plugin extends the Theme Blvd Layout Builder to allow you to assign your custom layouts to standard posts and custom post types. 5 Version: 1.0. 45 Version: 1.0.5 6 6 Author: Jason Bobich 7 7 Author URI: http://jasonbobich.com … … 26 26 */ 27 27 28 define( 'TB_LTP_PLUGIN_VERSION', '1.0. 4' );28 define( 'TB_LTP_PLUGIN_VERSION', '1.0.5' ); 29 29 define( 'TB_LTP_PLUGIN_DIR', dirname( __FILE__ ) ); 30 30 define( 'TB_LTP_PLUGIN_URI', plugins_url( '' , __FILE__ ) ); … … 38 38 39 39 // Check to make sure Theme Blvd Framework is running 40 if ( ! defined( 'TB_FRAMEWORK_VERSION' ) || ! defined( 'TB_BUILDER_PLUGIN_VERSION' ) ) {40 if ( ! defined( 'TB_FRAMEWORK_VERSION' ) || ! defined( 'TB_BUILDER_PLUGIN_VERSION' ) ) { 41 41 add_action( 'admin_notices', 'themeblvd_ltp_notice' ); 42 42 add_action( 'admin_init', 'themeblvd_ltp_disable_nag' ); … … 56 56 // Also, if there was a custom layout assigned with our option, 57 57 // we need to redirect to the template_builder.php file. 58 add_action( 'template_ redirect', 'themeblvd_ltp_redirect' );58 add_action( 'template_include', 'themeblvd_ltp_redirect' ); 59 59 60 60 } … … 125 125 $url = admin_url( $pagenow ); 126 126 127 if ( ! empty( $_SERVER['QUERY_STRING'] ) ) {127 if ( ! empty( $_SERVER['QUERY_STRING'] ) ) { 128 128 $url .= sprintf( '?%s&nag-ignore=%s', $_SERVER['QUERY_STRING'], 'tb-nag-'.$id ); 129 129 } else { … … 172 172 $layouts = get_posts('post_type=tb_layout&orderby=title&order=ASC&numberposts=-1'); 173 173 174 if ( $layouts ) {174 if ( $layouts ) { 175 175 176 176 $select = array( '' => '-- '.__( 'None', 'theme-blvd-layouts-to-posts' ).' --' ); … … 182 182 183 183 $options = array( 184 array(185 'id' => '_tb_placeholder',186 'std' => 1,187 'type' => 'hidden'188 ),189 184 array( 190 185 'id' => '_tb_custom_layout', … … 195 190 ); 196 191 197 if ( version_compare(TB_FRAMEWORK_VERSION, '2.5.0', '<') ) { 198 unset($options[0]); 199 } 200 201 // Start output 202 echo '<div id="optionsframework" class="tb-meta-box side">'; 192 // Start output. 193 // Note: #optionsframework ID needed prior to framewor 2.7. 194 // Note: .tb-options-wrap class needed in framework 2.7+. 195 echo '<div id="optionsframework" class="tb-meta-box tb-options-wrap side">'; 203 196 204 197 // Display options form … … 213 206 echo $form[0]; 214 207 215 } else if( function_exists( 'optionsframework_fields' ) ) {208 } elseif ( function_exists( 'optionsframework_fields' ) ) { 216 209 217 210 // Options form for TB framework v2.0 - v2.1 … … 266 259 267 260 // If any single post type 268 if ( is_single() ) {261 if ( is_single() ) { 269 262 270 263 // Get layout name if its been saved to this post. … … 272 265 273 266 // Only continue if a custom layout was selected 274 if ( $layout_name ) {267 if ( $layout_name ) { 275 268 276 269 if ( post_password_required() || ( 'private' == get_post_status() && ! current_user_can( 'edit_posts' ) ) ) { … … 286 279 $config['builder_post_id'] = themeblvd_post_id_by_name( $layout_name, 'tb_layout' ); // Needed in framework v2.2.1+ 287 280 281 $config['sidebar_layout'] = 'full_width'; 282 288 283 if ( $config['builder_post_id'] && version_compare(TB_FRAMEWORK_VERSION, '2.5.0', '<') ) { 289 284 … … 314 309 $config['sidebar_layout'] = $layout_settings['sidebar_layout']; 315 310 316 if ( 'default' == $config['sidebar_layout'] ) {311 if ( 'default' == $config['sidebar_layout'] ) { 317 312 $config['sidebar_layout'] = themeblvd_get_option( 'sidebar_layout', null, apply_filters( 'themeblvd_default_sidebar_layout', 'sidebar_right' ) ); 318 313 } … … 328 323 329 324 } 325 330 326 return $config; 331 327 } … … 342 338 * @since 1.0.0 343 339 */ 344 function themeblvd_ltp_redirect( $config ) { 345 // Include page template and exit if this is a 346 // single post AND the global config says there 347 // is a custom layout 348 if( is_single() && themeblvd_config( 'builder' ) ) { 349 include_once( locate_template( 'template_builder.php' ) ); 350 exit; 351 } 352 } 340 function themeblvd_ltp_redirect( $template ) { 341 342 // If post is password-protected, allow to 343 // use single.php so that the password forms 344 // shows instead of the custom layout. 345 if ( post_password_required() ) { 346 347 return $template; 348 349 } 350 351 // If this is a single post with a template applied, 352 // use the template_builder.php page template instead. 353 if ( is_single() && themeblvd_config( 'builder' ) ) { 354 355 return locate_template( 'template_builder.php' ); 356 357 } 358 359 return $template; 360 361 }
Note: See TracChangeset
for help on using the changeset viewer.