Changeset 1950988
- Timestamp:
- 10/03/2018 05:07:54 PM (8 years ago)
- Location:
- i-divi-post-settings
- Files:
-
- 10 edited
- 1 copied
-
tags/1.2 (copied) (copied from i-divi-post-settings/trunk)
-
tags/1.2/README.txt (modified) (4 diffs)
-
tags/1.2/admin/class-divi-post-settings-admin.php (modified) (8 diffs)
-
tags/1.2/admin/css/admin.css (modified) (1 diff)
-
tags/1.2/i_divi_post_settings.php (modified) (26 diffs)
-
tags/1.2/includes/class-divi-post-settings.php (modified) (1 diff)
-
trunk/README.txt (modified) (4 diffs)
-
trunk/admin/class-divi-post-settings-admin.php (modified) (8 diffs)
-
trunk/admin/css/admin.css (modified) (1 diff)
-
trunk/i_divi_post_settings.php (modified) (26 diffs)
-
trunk/includes/class-divi-post-settings.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
i-divi-post-settings/tags/1.2/README.txt
r1837140 r1950988 5 5 Requires at least: 4.0 6 6 Tested up to: 4.9 7 Stable tag: 1. 17 Stable tag: 1.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 38 38 The plugin accomplish a very simple task, giving you the possibility to set default post settings (those ones that you find in the Divi Post Settings meta box inside every post). This plugin, so, will simply let you to save time without have to set the values everytime you create a new post, page or project! 39 39 40 = Does the plugin add different settings for each post-type? = 41 Yes, it does. Once activated, the plugin adds settings for each post-type: Posts, Pages, Products (working only if WooCommerce is active) and Projects. You will find new settings in the Customizer under the Blog panel. 42 43 = Once Customizer settings have been set up, can i change Divi Settings manually from inside the post? = 44 Yes, of course. You can always change manually the Divi Settings from inside posts/pages/products/projects; however when hit 'Add New' button the settings you chose in the Customizer will be applied as the default ones. You can also choose to remember the last settings you used in a post/page/product/project for the next ones you will create by flagging the relative checkbox in the Customizer. 45 40 46 == Screenshots == 41 47 … … 46 52 47 53 == Changelog == 54 55 = 1.2 = 56 57 * Added support for WooCommerce products. 58 * Updated Fullwidth mode only for default post types (Posts). 59 * Added Customizer settings for WooCoommerce products. 48 60 49 61 = 1.1 = … … 70 82 == Upgrade Notice == 71 83 84 = 1.2 = 85 86 * Added Divi Settings for WooCommerce products. 87 72 88 = 1.1 = 73 89 -
i-divi-post-settings/tags/1.2/admin/class-divi-post-settings-admin.php
r1836529 r1950988 100 100 'choices' => array( 101 101 'Right' => 'Right Sidebar', 102 'Left' => 'Left Sidebar', 102 'Left' => 'Left Sidebar', 103 'No' => 'No Sidebar', 103 104 'Full' => 'Fullwidth', 104 105 ), … … 173 174 'Right' => 'Right Sidebar', 174 175 'Left' => 'Left Sidebar', 175 ' Full' => 'Fullwidth',176 'No' => 'No Sidebar', 176 177 ), 177 178 'priority' => 5, … … 211 212 'settings' => 'idivi_page_settings_before_scroll' 212 213 )); 214 215 216 // DIVI PRODUCT SETTINGS 217 $wp_customize->add_section('idivi_product_settings_section', array( 218 'title' => __('Divi Product Settings', $this->plugin_name), 219 'panel' => 'et_divi_blog_settings', 220 )); 221 $wp_customize->add_setting('idivi_product_settings_sidebar', array( 222 'default' => 'Right', 223 'type' => 'option', 224 'capability' => 'edit_theme_options', 225 )); 226 $wp_customize->add_control('idivi_product_settings_layout', array( 227 'label' => __('Page Layout', $this->plugin_name), 228 'section' => 'idivi_product_settings_section', 229 'type' => 'select', 230 'choices' => array( 231 'Right' => 'Right Sidebar', 232 'Left' => 'Left Sidebar', 233 'No' => 'No Sidebar', 234 ), 235 'priority' => 5, 236 'settings' => 'idivi_product_settings_sidebar' 237 )); 238 $wp_customize->add_setting('idivi_product_settings_dot', array( 239 'default' => 'Off', 240 'type' => 'option', 241 'capability' => 'edit_theme_options', 242 )); 243 $wp_customize->add_control('idivi_product_settings_dot_nav', array( 244 'label' => __('Dot Navigation', $this->plugin_name), 245 'section' => 'idivi_product_settings_section', 246 'type' => 'select', 247 'choices' => array( 248 'Off' => 'Off', 249 'On' => 'On', 250 ), 251 'priority' => 5, 252 'settings' => 'idivi_product_settings_dot' 253 )); 254 $wp_customize->add_setting('idivi_product_settings_before_scroll', array( 255 'default' => 'Default', 256 'type' => 'option', 257 'capability' => 'edit_theme_options', 258 )); 259 $wp_customize->add_control('idivi_product_settings_hide_before_scroll', array( 260 'label' => __('Hide Nav Before Scroll', $this->plugin_name), 261 'section' => 'idivi_product_settings_section', 262 'type' => 'select', 263 'choices' => array( 264 'Default' => 'Default', 265 'Off' => 'Off', 266 'On' => 'On', 267 ), 268 'priority' => 5, 269 'settings' => 'idivi_product_settings_before_scroll' 270 )); 213 271 214 272 … … 230 288 'Right' => 'Right Sidebar', 231 289 'Left' => 'Left Sidebar', 232 ' Full' => 'Fullwidth',290 'No' => 'No Sidebar', 233 291 ), 234 292 'priority' => 5, … … 311 369 'priority' => 10, 312 370 'settings' => 'idivi_page_settings_last_used' 313 )); 371 )); 372 373 $wp_customize->add_setting('idivi_product_settings_last_used', array( 374 'default' => false, 375 'type' => 'option', 376 'capability' => 'edit_theme_options', 377 )); 378 $wp_customize->add_control('idivi_product_settings_last_used_options', array( 379 'label' => __('Remember Last Used Options', $this->plugin_name), 380 'section' => 'idivi_product_settings_section', 381 'type' => 'checkbox', 382 'priority' => 10, 383 'settings' => 'idivi_product_settings_last_used' 384 )); 314 385 315 386 $wp_customize->add_setting('idivi_project_settings_last_used', array( … … 345 416 346 417 /** 347 * Create function that retrieves last p ostid418 * Create function that retrieves last page id 348 419 * @since 1.1 349 420 */ … … 363 434 364 435 /** 365 * Create function that retrieves last p ost id436 * Create function that retrieves last project id 366 437 * @since 1.1 367 438 */ … … 380 451 } 381 452 453 /** 454 * Create function that retrieves last product id 455 * @since 1.1 456 */ 457 public function get_last_product_id() { 458 $latest_product_args = array( 459 'numberposts' => 1, 460 'orderby' => 'post_date', 461 'post_type' => 'product', 462 'order' => 'DESC' 463 ); 464 $latest_product = wp_get_recent_posts( $latest_product_args ); 465 foreach ($latest_product as $product) { 466 $latest_product_id = $latest_product[0]["ID"]; 467 return $latest_product_id; 468 } 469 } 470 382 471 383 472 } -
i-divi-post-settings/tags/1.2/admin/css/admin.css
r1836529 r1950988 3 3 */ 4 4 #customize-control-idivi_post_settings_last_used_options, 5 #customize-control-idivi_page_settings_last_used_options, #customize-control-idivi_project_settings_last_used_options {5 #customize-control-idivi_page_settings_last_used_options, #customize-control-idivi_project_settings_last_used_options, #customize-control-idivi_product_settings_last_used_options { 6 6 margin-top: 10% !important; 7 7 } -
i-divi-post-settings/tags/1.2/i_divi_post_settings.php
r1836529 r1950988 5 5 * Description: The plugin add some fields in Divi Theme Customizer from which you can set your favorite default post, page and project settings. 6 6 * Author: Dan Mardis - Howidivit.com 7 * Version: 1. 17 * Version: 1.2 8 8 * Author URI: http://www.howidivit.com 9 9 */ … … 65 65 $page_layout_opt = get_option( 'idivi_page_settings_sidebar' ); 66 66 $project_layout_opt = get_option( 'idivi_project_settings_sidebar' ); 67 $product_layout_opt = get_option( 'idivi_product_settings_sidebar' ); 67 68 68 69 $dot_nav_opt = get_option( 'idivi_post_settings_dot' ); 69 70 $dot_page_nav_opt = get_option( 'idivi_page_settings_dot' ); 70 71 $dot_project_nav_opt = get_option( 'idivi_project_settings_dot' ); 72 $dot_product_nav_opt = get_option( 'idivi_product_settings_dot' ); 71 73 72 74 $before_scroll_opt = get_option( 'idivi_post_settings_before_scroll' ); 73 75 $before_page_scroll_opt = get_option( 'idivi_page_settings_before_scroll' ); 74 76 $before_project_scroll_opt = get_option( 'idivi_project_settings_before_scroll' ); 77 $before_product_scroll_opt = get_option( 'idivi_product_settings_before_scroll' ); 75 78 76 79 $title_opt = get_option( 'idivi_post_settings_post_title' ); … … 80 83 $last_page_used = get_option('idivi_page_settings_last_used'); 81 84 $last_project_used = get_option('idivi_project_settings_last_used'); 85 $last_product_used = get_option('idivi_product_settings_last_used'); 82 86 83 87 // call admin class function for getting last post id … … 86 90 $last_page_id = $last_post_used->get_last_page_id(); 87 91 $last_project_id = $last_post_used->get_last_project_id(); 92 $last_product_id = $last_post_used->get_last_product_id(); 88 93 89 94 // retrieve last post values … … 102 107 103 108 $last_project_nav = get_post_meta( $last_project_id, '_et_pb_project_nav', true ); 109 110 $last_product_layout = get_post_meta( $last_product_id, '_et_pb_page_layout', true ); 111 $last_product_side_nav = get_post_meta( $last_product_id, '_et_pb_side_nav', true ); 112 $last_product_hide_nav = get_post_meta( $last_product_id, '_et_pb_post_hide_nav', true ); 104 113 105 114 wp_nonce_field( basename( __FILE__ ), 'et_settings_nonce' ); … … 111 120 $post_hide_nav = $post_hide_nav && 'off' === $post_hide_nav ? 'default' : $post_hide_nav; 112 121 $show_title = get_post_meta( $post_id, '_et_pb_show_title', true ); 122 123 $is_builder_active = 'on' === get_post_meta( $post_id, '_et_pb_use_builder', true ); 113 124 114 125 if ( 'post' === $post->post_type ) { … … 122 133 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 123 134 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 135 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 124 136 'et_full_width_page' => esc_html__( 'Fullwidth', 'Divi' ), 125 137 ); … … 128 140 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 129 141 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 142 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 130 143 'et_full_width_page' => esc_html__( 'Fullwidth', 'Divi' ), 131 144 ); … … 139 152 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 140 153 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 154 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 141 155 'et_full_width_page' => esc_html__( 'Fullwidth', 'Divi' ), 142 156 ); … … 145 159 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 146 160 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 161 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 147 162 'et_full_width_page' => esc_html__( 'Fullwidth', 'Divi' ), 148 163 ); 149 164 } 150 } else { 165 } else if ( 166 ( $post_layout_opt === 'Full' && (!isset($last_used) || empty($last_used)) ) || 167 ( ( isset($last_used) && ($last_used == 1) ) && $last_post_layout === 'et_full_width_page') 168 ) { 169 if ( is_rtl() ) { 170 $page_layouts = array( 171 'et_full_width_page' => esc_html__( 'Fullwidth', 'Divi' ), 172 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 173 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 174 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 175 ); 176 } else { 177 $page_layouts = array( 178 'et_full_width_page' => esc_html__( 'Fullwidth', 'Divi' ), 179 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 180 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 181 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 182 ); 183 } 184 } else { 151 185 if ( is_rtl() ) { 152 186 $page_layouts = array( 153 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),187 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 154 188 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 155 189 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 190 'et_full_width_page' => esc_html__( 'Fullwidth', 'Divi' ), 156 191 ); 157 192 } else { 158 193 $page_layouts = array( 159 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),194 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 160 195 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 161 196 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 197 'et_full_width_page' => esc_html__( 'Fullwidth', 'Divi' ), 162 198 ); 163 199 } 164 200 } 165 } else if ( 'page' === $post->post_type ) { 201 } else if ( 'page' === $post->post_type ) { 166 202 if ( 167 203 ( !$page_layout_opt && (!isset($last_page_used) || empty($last_page_used) ) ) || … … 173 209 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 174 210 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 175 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),211 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 176 212 ); 177 213 } else { … … 179 215 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 180 216 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 181 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),217 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 182 218 ); 183 219 } … … 190 226 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 191 227 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 192 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),228 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 193 229 ); 194 230 } else { … … 196 232 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 197 233 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 198 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),234 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 199 235 ); 200 236 } … … 202 238 if ( is_rtl() ) { 203 239 $page_layouts = array( 204 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),240 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 205 241 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 206 242 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), … … 208 244 } else { 209 245 $page_layouts = array( 210 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),246 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 211 247 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 212 248 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), … … 224 260 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 225 261 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 226 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),262 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 227 263 ); 228 264 } else { … … 230 266 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 231 267 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 232 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),268 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 233 269 ); 234 270 } … … 241 277 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 242 278 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 243 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),279 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 244 280 ); 245 281 } else { … … 247 283 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 248 284 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 249 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),285 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 250 286 ); 251 287 } … … 253 289 if ( is_rtl() ) { 254 290 $page_layouts = array( 255 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),291 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 256 292 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 257 293 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), … … 259 295 } else { 260 296 $page_layouts = array( 261 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),297 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 262 298 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 263 299 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), … … 265 301 } 266 302 } 267 } 303 } else if ( 'product' === $post->post_type ) { 304 if ( 305 ( !$product_layout_opt && (!isset($last_product_used) || empty($last_product_used) ) ) || 306 ( $product_layout_opt === 'Right' && (!isset($last_product_used) || empty($last_product_used)) ) || 307 ( ( isset($last_product_used) && ($last_product_used == 1) ) && $last_product_layout === 'et_right_sidebar') 308 ) { 309 if ( is_rtl() ) { 310 $page_layouts = array( 311 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 312 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 313 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 314 ); 315 } else { 316 $page_layouts = array( 317 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 318 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 319 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 320 ); 321 } 322 } else if ( 323 ( $product_layout_opt === 'Left' && (!isset($last_product_used) || empty($last_product_used)) ) || 324 ( ( isset($last_product_used) && ($last_product_used == 1) ) && $last_product_layout === 'et_left_sidebar') 325 ) { 326 if ( is_rtl() ) { 327 $page_layouts = array( 328 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 329 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 330 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 331 ); 332 } else { 333 $page_layouts = array( 334 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 335 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 336 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 337 ); 338 } 339 } else { 340 if ( is_rtl() ) { 341 $page_layouts = array( 342 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 343 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 344 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 345 ); 346 } else { 347 $page_layouts = array( 348 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 349 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 350 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 351 ); 352 } 353 } 354 } 355 356 // Fullwidth option available for default post types only. Not available for custom post types. 357 if ( ! et_builder_is_post_type_custom( $post->post_type ) ) { 358 $page_layouts['et_full_width_page'] = esc_html__( 'Fullwidth', 'Divi' ); 359 } 360 361 if ( 'et_full_width_page' === $page_layout && ( ! isset( $page_layouts['et_full_width_page'] ) || ! $is_builder_active ) ) { 362 $page_layout = 'et_no_sidebar'; 363 } 364 268 365 $layouts = array( 269 366 'light' => esc_html__( 'Light', 'Divi' ), … … 286 383 <?php 287 384 foreach ( $page_layouts as $layout_value => $layout_name ) { 288 printf( '<option value="%2$s"%3$s >%1$s</option>',385 printf( '<option value="%2$s"%3$s%4$s>%1$s</option>', 289 386 esc_html( $layout_name ), 290 387 esc_attr( $layout_value ), 291 selected( $layout_value, $page_layout, false ) 388 selected( $layout_value, $page_layout, false ), 389 'et_full_width_page' === $layout_value && ! $is_builder_active ? ' style="display: none;"' : '' 292 390 ); 293 391 } ?> … … 346 444 </select> 347 445 <?php } 348 } ?> 446 } else if ( 'product' === $post->post_type ) { 447 if ( 448 ( !$dot_product_nav_opt && (!isset($last_product_used) || empty($last_product_used) ) ) || 449 ( $dot_product_nav_opt === 'Off' && (!isset($last_product_used) || empty($last_product_used) ) ) || 450 (( isset($last_product_used) && ($last_product_used == 1) ) && $last_product_side_nav === 'off') 451 ) { ?> 452 <select id="et_pb_side_nav" name="et_pb_side_nav"> 453 <option value="off" <?php selected( 'off', $side_nav ); ?>><?php esc_html_e( 'Off', 'Divi' ); ?></option> 454 <option value="on" <?php selected( 'on', $side_nav ); ?>><?php esc_html_e( 'On', 'Divi' ); ?></option> 455 </select> 456 <?php } else { ?> 457 <select id="et_pb_side_nav" name="et_pb_side_nav"> 458 <option value="on" <?php selected( 'on', $side_nav ); ?>><?php esc_html_e( 'On', 'Divi' ); ?></option> 459 <option value="off" <?php selected( 'off', $side_nav ); ?>><?php esc_html_e( 'Off', 'Divi' ); ?></option> 460 </select> 461 <?php } 462 } ?> 349 463 350 464 </p> … … 434 548 <?php 435 549 } 436 } 550 } else if ( 'product' === $post->post_type ) { 551 if ( 552 ( !$before_product_scroll_opt && (!isset($last_product_used) || empty($last_product_used) ) ) || 553 ( $before_product_scroll_opt === 'Default' && (!isset($last_product_used) || empty($last_product_used) ) ) || 554 (( isset($last_product_used) && ($last_product_used == 1) ) && $last_product_hide_nav === 'default') 555 ) { ?> 556 <select id="et_pb_post_hide_nav" name="et_pb_post_hide_nav"> 557 <option value="default" <?php selected( 'default', $post_hide_nav ); ?>><?php esc_html_e( 'Default', 'Divi' ); ?></option> 558 <option value="no" <?php selected( 'no', $post_hide_nav ); ?>><?php esc_html_e( 'Off', 'Divi' ); ?></option> 559 <option value="on" <?php selected( 'on', $post_hide_nav ); ?>><?php esc_html_e( 'On', 'Divi' ); ?></option> 560 </select> 561 <?php } else if ( 562 ( $before_product_scroll_opt === 'Off' && (!isset($last_product_used) || empty($last_product_used)) ) || 563 ( ( isset($last_product_used) && ($last_product_used == 1) ) && $last_product_hide_nav === 'no') 564 ) { ?> 565 <select id="et_pb_post_hide_nav" name="et_pb_post_hide_nav"> 566 <option value="no" <?php selected( 'no', $post_hide_nav ); ?>><?php esc_html_e( 'Off', 'Divi' ); ?></option> 567 <option value="default" <?php selected( 'default', $post_hide_nav ); ?>><?php esc_html_e( 'Default', 'Divi' ); ?></option> 568 <option value="on" <?php selected( 'on', $post_hide_nav ); ?>><?php esc_html_e( 'On', 'Divi' ); ?></option> 569 </select> 570 <?php } else { ?> 571 <select id="et_pb_post_hide_nav" name="et_pb_post_hide_nav"> 572 <option value="on" <?php selected( 'on', $post_hide_nav ); ?>><?php esc_html_e( 'On', 'Divi' ); ?></option> 573 <option value="default" <?php selected( 'default', $post_hide_nav ); ?>><?php esc_html_e( 'Default', 'Divi' ); ?></option> 574 <option value="no" <?php selected( 'no', $post_hide_nav ); ?>><?php esc_html_e( 'Off', 'Divi' ); ?></option> 575 </select> 576 <?php 577 } 578 } 437 579 ?> 438 580 </p> -
i-divi-post-settings/tags/1.2/includes/class-divi-post-settings.php
r1836529 r1950988 22 22 23 23 $this->plugin_name = 'i-divi_post_settings'; 24 $this->version = '1. 1';24 $this->version = '1.2'; 25 25 26 26 $this->load_dependencies(); -
i-divi-post-settings/trunk/README.txt
r1837140 r1950988 5 5 Requires at least: 4.0 6 6 Tested up to: 4.9 7 Stable tag: 1. 17 Stable tag: 1.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 38 38 The plugin accomplish a very simple task, giving you the possibility to set default post settings (those ones that you find in the Divi Post Settings meta box inside every post). This plugin, so, will simply let you to save time without have to set the values everytime you create a new post, page or project! 39 39 40 = Does the plugin add different settings for each post-type? = 41 Yes, it does. Once activated, the plugin adds settings for each post-type: Posts, Pages, Products (working only if WooCommerce is active) and Projects. You will find new settings in the Customizer under the Blog panel. 42 43 = Once Customizer settings have been set up, can i change Divi Settings manually from inside the post? = 44 Yes, of course. You can always change manually the Divi Settings from inside posts/pages/products/projects; however when hit 'Add New' button the settings you chose in the Customizer will be applied as the default ones. You can also choose to remember the last settings you used in a post/page/product/project for the next ones you will create by flagging the relative checkbox in the Customizer. 45 40 46 == Screenshots == 41 47 … … 46 52 47 53 == Changelog == 54 55 = 1.2 = 56 57 * Added support for WooCommerce products. 58 * Updated Fullwidth mode only for default post types (Posts). 59 * Added Customizer settings for WooCoommerce products. 48 60 49 61 = 1.1 = … … 70 82 == Upgrade Notice == 71 83 84 = 1.2 = 85 86 * Added Divi Settings for WooCommerce products. 87 72 88 = 1.1 = 73 89 -
i-divi-post-settings/trunk/admin/class-divi-post-settings-admin.php
r1836529 r1950988 100 100 'choices' => array( 101 101 'Right' => 'Right Sidebar', 102 'Left' => 'Left Sidebar', 102 'Left' => 'Left Sidebar', 103 'No' => 'No Sidebar', 103 104 'Full' => 'Fullwidth', 104 105 ), … … 173 174 'Right' => 'Right Sidebar', 174 175 'Left' => 'Left Sidebar', 175 ' Full' => 'Fullwidth',176 'No' => 'No Sidebar', 176 177 ), 177 178 'priority' => 5, … … 211 212 'settings' => 'idivi_page_settings_before_scroll' 212 213 )); 214 215 216 // DIVI PRODUCT SETTINGS 217 $wp_customize->add_section('idivi_product_settings_section', array( 218 'title' => __('Divi Product Settings', $this->plugin_name), 219 'panel' => 'et_divi_blog_settings', 220 )); 221 $wp_customize->add_setting('idivi_product_settings_sidebar', array( 222 'default' => 'Right', 223 'type' => 'option', 224 'capability' => 'edit_theme_options', 225 )); 226 $wp_customize->add_control('idivi_product_settings_layout', array( 227 'label' => __('Page Layout', $this->plugin_name), 228 'section' => 'idivi_product_settings_section', 229 'type' => 'select', 230 'choices' => array( 231 'Right' => 'Right Sidebar', 232 'Left' => 'Left Sidebar', 233 'No' => 'No Sidebar', 234 ), 235 'priority' => 5, 236 'settings' => 'idivi_product_settings_sidebar' 237 )); 238 $wp_customize->add_setting('idivi_product_settings_dot', array( 239 'default' => 'Off', 240 'type' => 'option', 241 'capability' => 'edit_theme_options', 242 )); 243 $wp_customize->add_control('idivi_product_settings_dot_nav', array( 244 'label' => __('Dot Navigation', $this->plugin_name), 245 'section' => 'idivi_product_settings_section', 246 'type' => 'select', 247 'choices' => array( 248 'Off' => 'Off', 249 'On' => 'On', 250 ), 251 'priority' => 5, 252 'settings' => 'idivi_product_settings_dot' 253 )); 254 $wp_customize->add_setting('idivi_product_settings_before_scroll', array( 255 'default' => 'Default', 256 'type' => 'option', 257 'capability' => 'edit_theme_options', 258 )); 259 $wp_customize->add_control('idivi_product_settings_hide_before_scroll', array( 260 'label' => __('Hide Nav Before Scroll', $this->plugin_name), 261 'section' => 'idivi_product_settings_section', 262 'type' => 'select', 263 'choices' => array( 264 'Default' => 'Default', 265 'Off' => 'Off', 266 'On' => 'On', 267 ), 268 'priority' => 5, 269 'settings' => 'idivi_product_settings_before_scroll' 270 )); 213 271 214 272 … … 230 288 'Right' => 'Right Sidebar', 231 289 'Left' => 'Left Sidebar', 232 ' Full' => 'Fullwidth',290 'No' => 'No Sidebar', 233 291 ), 234 292 'priority' => 5, … … 311 369 'priority' => 10, 312 370 'settings' => 'idivi_page_settings_last_used' 313 )); 371 )); 372 373 $wp_customize->add_setting('idivi_product_settings_last_used', array( 374 'default' => false, 375 'type' => 'option', 376 'capability' => 'edit_theme_options', 377 )); 378 $wp_customize->add_control('idivi_product_settings_last_used_options', array( 379 'label' => __('Remember Last Used Options', $this->plugin_name), 380 'section' => 'idivi_product_settings_section', 381 'type' => 'checkbox', 382 'priority' => 10, 383 'settings' => 'idivi_product_settings_last_used' 384 )); 314 385 315 386 $wp_customize->add_setting('idivi_project_settings_last_used', array( … … 345 416 346 417 /** 347 * Create function that retrieves last p ostid418 * Create function that retrieves last page id 348 419 * @since 1.1 349 420 */ … … 363 434 364 435 /** 365 * Create function that retrieves last p ost id436 * Create function that retrieves last project id 366 437 * @since 1.1 367 438 */ … … 380 451 } 381 452 453 /** 454 * Create function that retrieves last product id 455 * @since 1.1 456 */ 457 public function get_last_product_id() { 458 $latest_product_args = array( 459 'numberposts' => 1, 460 'orderby' => 'post_date', 461 'post_type' => 'product', 462 'order' => 'DESC' 463 ); 464 $latest_product = wp_get_recent_posts( $latest_product_args ); 465 foreach ($latest_product as $product) { 466 $latest_product_id = $latest_product[0]["ID"]; 467 return $latest_product_id; 468 } 469 } 470 382 471 383 472 } -
i-divi-post-settings/trunk/admin/css/admin.css
r1836529 r1950988 3 3 */ 4 4 #customize-control-idivi_post_settings_last_used_options, 5 #customize-control-idivi_page_settings_last_used_options, #customize-control-idivi_project_settings_last_used_options {5 #customize-control-idivi_page_settings_last_used_options, #customize-control-idivi_project_settings_last_used_options, #customize-control-idivi_product_settings_last_used_options { 6 6 margin-top: 10% !important; 7 7 } -
i-divi-post-settings/trunk/i_divi_post_settings.php
r1836529 r1950988 5 5 * Description: The plugin add some fields in Divi Theme Customizer from which you can set your favorite default post, page and project settings. 6 6 * Author: Dan Mardis - Howidivit.com 7 * Version: 1. 17 * Version: 1.2 8 8 * Author URI: http://www.howidivit.com 9 9 */ … … 65 65 $page_layout_opt = get_option( 'idivi_page_settings_sidebar' ); 66 66 $project_layout_opt = get_option( 'idivi_project_settings_sidebar' ); 67 $product_layout_opt = get_option( 'idivi_product_settings_sidebar' ); 67 68 68 69 $dot_nav_opt = get_option( 'idivi_post_settings_dot' ); 69 70 $dot_page_nav_opt = get_option( 'idivi_page_settings_dot' ); 70 71 $dot_project_nav_opt = get_option( 'idivi_project_settings_dot' ); 72 $dot_product_nav_opt = get_option( 'idivi_product_settings_dot' ); 71 73 72 74 $before_scroll_opt = get_option( 'idivi_post_settings_before_scroll' ); 73 75 $before_page_scroll_opt = get_option( 'idivi_page_settings_before_scroll' ); 74 76 $before_project_scroll_opt = get_option( 'idivi_project_settings_before_scroll' ); 77 $before_product_scroll_opt = get_option( 'idivi_product_settings_before_scroll' ); 75 78 76 79 $title_opt = get_option( 'idivi_post_settings_post_title' ); … … 80 83 $last_page_used = get_option('idivi_page_settings_last_used'); 81 84 $last_project_used = get_option('idivi_project_settings_last_used'); 85 $last_product_used = get_option('idivi_product_settings_last_used'); 82 86 83 87 // call admin class function for getting last post id … … 86 90 $last_page_id = $last_post_used->get_last_page_id(); 87 91 $last_project_id = $last_post_used->get_last_project_id(); 92 $last_product_id = $last_post_used->get_last_product_id(); 88 93 89 94 // retrieve last post values … … 102 107 103 108 $last_project_nav = get_post_meta( $last_project_id, '_et_pb_project_nav', true ); 109 110 $last_product_layout = get_post_meta( $last_product_id, '_et_pb_page_layout', true ); 111 $last_product_side_nav = get_post_meta( $last_product_id, '_et_pb_side_nav', true ); 112 $last_product_hide_nav = get_post_meta( $last_product_id, '_et_pb_post_hide_nav', true ); 104 113 105 114 wp_nonce_field( basename( __FILE__ ), 'et_settings_nonce' ); … … 111 120 $post_hide_nav = $post_hide_nav && 'off' === $post_hide_nav ? 'default' : $post_hide_nav; 112 121 $show_title = get_post_meta( $post_id, '_et_pb_show_title', true ); 122 123 $is_builder_active = 'on' === get_post_meta( $post_id, '_et_pb_use_builder', true ); 113 124 114 125 if ( 'post' === $post->post_type ) { … … 122 133 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 123 134 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 135 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 124 136 'et_full_width_page' => esc_html__( 'Fullwidth', 'Divi' ), 125 137 ); … … 128 140 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 129 141 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 142 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 130 143 'et_full_width_page' => esc_html__( 'Fullwidth', 'Divi' ), 131 144 ); … … 139 152 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 140 153 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 154 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 141 155 'et_full_width_page' => esc_html__( 'Fullwidth', 'Divi' ), 142 156 ); … … 145 159 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 146 160 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 161 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 147 162 'et_full_width_page' => esc_html__( 'Fullwidth', 'Divi' ), 148 163 ); 149 164 } 150 } else { 165 } else if ( 166 ( $post_layout_opt === 'Full' && (!isset($last_used) || empty($last_used)) ) || 167 ( ( isset($last_used) && ($last_used == 1) ) && $last_post_layout === 'et_full_width_page') 168 ) { 169 if ( is_rtl() ) { 170 $page_layouts = array( 171 'et_full_width_page' => esc_html__( 'Fullwidth', 'Divi' ), 172 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 173 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 174 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 175 ); 176 } else { 177 $page_layouts = array( 178 'et_full_width_page' => esc_html__( 'Fullwidth', 'Divi' ), 179 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 180 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 181 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 182 ); 183 } 184 } else { 151 185 if ( is_rtl() ) { 152 186 $page_layouts = array( 153 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),187 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 154 188 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 155 189 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 190 'et_full_width_page' => esc_html__( 'Fullwidth', 'Divi' ), 156 191 ); 157 192 } else { 158 193 $page_layouts = array( 159 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),194 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 160 195 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 161 196 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 197 'et_full_width_page' => esc_html__( 'Fullwidth', 'Divi' ), 162 198 ); 163 199 } 164 200 } 165 } else if ( 'page' === $post->post_type ) { 201 } else if ( 'page' === $post->post_type ) { 166 202 if ( 167 203 ( !$page_layout_opt && (!isset($last_page_used) || empty($last_page_used) ) ) || … … 173 209 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 174 210 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 175 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),211 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 176 212 ); 177 213 } else { … … 179 215 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 180 216 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 181 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),217 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 182 218 ); 183 219 } … … 190 226 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 191 227 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 192 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),228 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 193 229 ); 194 230 } else { … … 196 232 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 197 233 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 198 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),234 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 199 235 ); 200 236 } … … 202 238 if ( is_rtl() ) { 203 239 $page_layouts = array( 204 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),240 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 205 241 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 206 242 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), … … 208 244 } else { 209 245 $page_layouts = array( 210 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),246 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 211 247 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 212 248 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), … … 224 260 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 225 261 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 226 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),262 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 227 263 ); 228 264 } else { … … 230 266 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 231 267 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 232 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),268 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 233 269 ); 234 270 } … … 241 277 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 242 278 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 243 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),279 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 244 280 ); 245 281 } else { … … 247 283 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 248 284 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 249 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),285 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 250 286 ); 251 287 } … … 253 289 if ( is_rtl() ) { 254 290 $page_layouts = array( 255 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),291 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 256 292 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 257 293 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), … … 259 295 } else { 260 296 $page_layouts = array( 261 'et_ full_width_page' => esc_html__( 'Fullwidth', 'Divi' ),297 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 262 298 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 263 299 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), … … 265 301 } 266 302 } 267 } 303 } else if ( 'product' === $post->post_type ) { 304 if ( 305 ( !$product_layout_opt && (!isset($last_product_used) || empty($last_product_used) ) ) || 306 ( $product_layout_opt === 'Right' && (!isset($last_product_used) || empty($last_product_used)) ) || 307 ( ( isset($last_product_used) && ($last_product_used == 1) ) && $last_product_layout === 'et_right_sidebar') 308 ) { 309 if ( is_rtl() ) { 310 $page_layouts = array( 311 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 312 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 313 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 314 ); 315 } else { 316 $page_layouts = array( 317 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 318 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 319 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 320 ); 321 } 322 } else if ( 323 ( $product_layout_opt === 'Left' && (!isset($last_product_used) || empty($last_product_used)) ) || 324 ( ( isset($last_product_used) && ($last_product_used == 1) ) && $last_product_layout === 'et_left_sidebar') 325 ) { 326 if ( is_rtl() ) { 327 $page_layouts = array( 328 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 329 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 330 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 331 ); 332 } else { 333 $page_layouts = array( 334 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 335 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 336 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 337 ); 338 } 339 } else { 340 if ( is_rtl() ) { 341 $page_layouts = array( 342 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 343 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 344 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 345 ); 346 } else { 347 $page_layouts = array( 348 'et_no_sidebar' => esc_html__( 'No Sidebar', 'Divi' ), 349 'et_right_sidebar' => esc_html__( 'Right Sidebar', 'Divi' ), 350 'et_left_sidebar' => esc_html__( 'Left Sidebar', 'Divi' ), 351 ); 352 } 353 } 354 } 355 356 // Fullwidth option available for default post types only. Not available for custom post types. 357 if ( ! et_builder_is_post_type_custom( $post->post_type ) ) { 358 $page_layouts['et_full_width_page'] = esc_html__( 'Fullwidth', 'Divi' ); 359 } 360 361 if ( 'et_full_width_page' === $page_layout && ( ! isset( $page_layouts['et_full_width_page'] ) || ! $is_builder_active ) ) { 362 $page_layout = 'et_no_sidebar'; 363 } 364 268 365 $layouts = array( 269 366 'light' => esc_html__( 'Light', 'Divi' ), … … 286 383 <?php 287 384 foreach ( $page_layouts as $layout_value => $layout_name ) { 288 printf( '<option value="%2$s"%3$s >%1$s</option>',385 printf( '<option value="%2$s"%3$s%4$s>%1$s</option>', 289 386 esc_html( $layout_name ), 290 387 esc_attr( $layout_value ), 291 selected( $layout_value, $page_layout, false ) 388 selected( $layout_value, $page_layout, false ), 389 'et_full_width_page' === $layout_value && ! $is_builder_active ? ' style="display: none;"' : '' 292 390 ); 293 391 } ?> … … 346 444 </select> 347 445 <?php } 348 } ?> 446 } else if ( 'product' === $post->post_type ) { 447 if ( 448 ( !$dot_product_nav_opt && (!isset($last_product_used) || empty($last_product_used) ) ) || 449 ( $dot_product_nav_opt === 'Off' && (!isset($last_product_used) || empty($last_product_used) ) ) || 450 (( isset($last_product_used) && ($last_product_used == 1) ) && $last_product_side_nav === 'off') 451 ) { ?> 452 <select id="et_pb_side_nav" name="et_pb_side_nav"> 453 <option value="off" <?php selected( 'off', $side_nav ); ?>><?php esc_html_e( 'Off', 'Divi' ); ?></option> 454 <option value="on" <?php selected( 'on', $side_nav ); ?>><?php esc_html_e( 'On', 'Divi' ); ?></option> 455 </select> 456 <?php } else { ?> 457 <select id="et_pb_side_nav" name="et_pb_side_nav"> 458 <option value="on" <?php selected( 'on', $side_nav ); ?>><?php esc_html_e( 'On', 'Divi' ); ?></option> 459 <option value="off" <?php selected( 'off', $side_nav ); ?>><?php esc_html_e( 'Off', 'Divi' ); ?></option> 460 </select> 461 <?php } 462 } ?> 349 463 350 464 </p> … … 434 548 <?php 435 549 } 436 } 550 } else if ( 'product' === $post->post_type ) { 551 if ( 552 ( !$before_product_scroll_opt && (!isset($last_product_used) || empty($last_product_used) ) ) || 553 ( $before_product_scroll_opt === 'Default' && (!isset($last_product_used) || empty($last_product_used) ) ) || 554 (( isset($last_product_used) && ($last_product_used == 1) ) && $last_product_hide_nav === 'default') 555 ) { ?> 556 <select id="et_pb_post_hide_nav" name="et_pb_post_hide_nav"> 557 <option value="default" <?php selected( 'default', $post_hide_nav ); ?>><?php esc_html_e( 'Default', 'Divi' ); ?></option> 558 <option value="no" <?php selected( 'no', $post_hide_nav ); ?>><?php esc_html_e( 'Off', 'Divi' ); ?></option> 559 <option value="on" <?php selected( 'on', $post_hide_nav ); ?>><?php esc_html_e( 'On', 'Divi' ); ?></option> 560 </select> 561 <?php } else if ( 562 ( $before_product_scroll_opt === 'Off' && (!isset($last_product_used) || empty($last_product_used)) ) || 563 ( ( isset($last_product_used) && ($last_product_used == 1) ) && $last_product_hide_nav === 'no') 564 ) { ?> 565 <select id="et_pb_post_hide_nav" name="et_pb_post_hide_nav"> 566 <option value="no" <?php selected( 'no', $post_hide_nav ); ?>><?php esc_html_e( 'Off', 'Divi' ); ?></option> 567 <option value="default" <?php selected( 'default', $post_hide_nav ); ?>><?php esc_html_e( 'Default', 'Divi' ); ?></option> 568 <option value="on" <?php selected( 'on', $post_hide_nav ); ?>><?php esc_html_e( 'On', 'Divi' ); ?></option> 569 </select> 570 <?php } else { ?> 571 <select id="et_pb_post_hide_nav" name="et_pb_post_hide_nav"> 572 <option value="on" <?php selected( 'on', $post_hide_nav ); ?>><?php esc_html_e( 'On', 'Divi' ); ?></option> 573 <option value="default" <?php selected( 'default', $post_hide_nav ); ?>><?php esc_html_e( 'Default', 'Divi' ); ?></option> 574 <option value="no" <?php selected( 'no', $post_hide_nav ); ?>><?php esc_html_e( 'Off', 'Divi' ); ?></option> 575 </select> 576 <?php 577 } 578 } 437 579 ?> 438 580 </p> -
i-divi-post-settings/trunk/includes/class-divi-post-settings.php
r1836529 r1950988 22 22 23 23 $this->plugin_name = 'i-divi_post_settings'; 24 $this->version = '1. 1';24 $this->version = '1.2'; 25 25 26 26 $this->load_dependencies();
Note: See TracChangeset
for help on using the changeset viewer.