| @@ -35,10 +35,10 @@ | ||
| 35 | 35 | |
| 36 | 36 | public function __construct(array $configs) |
| 37 | 37 | { |
| 38 | 38 | |
| 39 | - // merge configs with default value | |
| 40 | - $configs = array_merge(array( | |
| 39 | + // extract and set default value | |
| 40 | + extract($test = array_merge(array( | |
| 41 | 41 | 'is_dev_mode' => false, |
| 42 | 42 | 'use_auto_group_naming' => true, |
| 43 | 43 | 'use_util_menu' => true, |
| 44 | 44 | 'minimum_role' => 'edit_theme_options', |
| @@ -43,27 +43,20 @@ | ||
| 43 | 43 | 'use_util_menu' => true, |
| 44 | 44 | 'minimum_role' => 'edit_theme_options', |
| 45 | 45 | 'menu_page' => 'themes.php', |
| 46 | 46 | 'layout' => 'fixed', |
| 47 | - 'page_title' => __( 'Vafpress Options', 'wp-ultimate-post-grid' ), | |
| 48 | - 'menu_label' => __( 'Vafpress Options', 'wp-ultimate-post-grid' ), | |
| 47 | + 'page_title' => __( 'Vafpress Options', 'wp-ultimate-recipe' ), | |
| 48 | + 'menu_label' => __( 'Vafpress Options', 'wp-ultimate-recipe' ), | |
| 49 | 49 | 'priority' => 10, |
| 50 | - ), $configs); | |
| 50 | + ), $configs)); | |
| 51 | 51 | |
| 52 | - // options config filter | |
| 53 | - $configs = apply_filters('vp_option_configuration_array' , $configs, $configs['option_key']); | |
| 54 | - $configs = apply_filters('vp_option_configuration_array-' . $configs['option_key'], $configs); | |
| 55 | - | |
| 56 | - // extract the configs | |
| 57 | - extract($configs); | |
| 58 | - | |
| 59 | 52 | // check and set required configs |
| 60 | 53 | if(isset($option_key)) $this->set_option_key($option_key); |
| 61 | - else throw new Exception(__( 'Option Key is required', 'wp-ultimate-post-grid' ), 1); | |
| 54 | + else throw new Exception(__( 'Option Key is required', 'wp-ultimate-recipe' ), 1); | |
| 62 | 55 | if(isset($template)) $this->set_template($template); |
| 63 | - else throw new Exception(__( 'Template Array/File is required', 'wp-ultimate-post-grid' ), 1); | |
| 56 | + else throw new Exception(__( 'Template Array/File is required', 'wp-ultimate-recipe' ), 1); | |
| 64 | 57 | if(isset($page_slug)) $this->set_page_slug($page_slug); |
| 65 | - else throw new Exception(__( 'Page Slug is required', 'wp-ultimate-post-grid' ), 1); | |
| 58 | + else throw new Exception(__( 'Page Slug is required', 'wp-ultimate-recipe' ), 1); | |
| 66 | 59 | |
| 67 | 60 | // swim in the pool |
| 68 | 61 | self::$pool[$this->get_option_key()] = &$this; |
| 69 | 62 | |
| @@ -163,9 +156,9 @@ | ||
| 163 | 156 | } |
| 164 | 157 | |
| 165 | 158 | public function dev_mode_notice() |
| 166 | 159 | { |
| 167 | - VP_WP_Util::admin_notice(__("Development Mode is Active, options' values won't be saved into database.", 'wp-ultimate-post-grid'), false); | |
| 160 | + VP_WP_Util::admin_notice(__("Development Mode is Active, options' values won't be saved into database.", 'wp-ultimate-recipe'), false); | |
| 168 | 161 | } |
| 169 | 162 | |
| 170 | 163 | public function enqueue_scripts_and_styles() |
| 171 | 164 | { |
| @@ -302,9 +295,9 @@ | ||
| 302 | 295 | |
| 303 | 296 | if(empty($option)) |
| 304 | 297 | { |
| 305 | 298 | $result['status'] = false; |
| 306 | - $result['message'] = __("Can not be empty", 'wp-ultimate-post-grid'); | |
| 299 | + $result['message'] = __("Can not be empty", 'wp-ultimate-recipe'); | |
| 307 | 300 | } |
| 308 | 301 | else |
| 309 | 302 | { |
| 310 | 303 | $option = json_decode(stripslashes($option), true); |
| @@ -327,9 +320,9 @@ | ||
| 327 | 320 | } |
| 328 | 321 | else |
| 329 | 322 | { |
| 330 | 323 | $result['status'] = false; |
| 331 | - $result['message'] = __("Invalid data", 'wp-ultimate-post-grid'); | |
| 324 | + $result['message'] = __("Invalid data", 'wp-ultimate-recipe'); | |
| 332 | 325 | } |
| 333 | 326 | } |
| 334 | 327 | } |
| 335 | 328 | |
| @@ -360,9 +353,9 @@ | ||
| 360 | 353 | $sr_options = json_encode($db_options); |
| 361 | 354 | |
| 362 | 355 | $result = array( |
| 363 | 356 | 'status' => true, |
| 364 | - 'message'=> __("Successful", 'wp-ultimate-post-grid'), | |
| 357 | + 'message'=> __("Successful", 'wp-ultimate-recipe'), | |
| 365 | 358 | 'option' => $sr_options, |
| 366 | 359 | ); |
| 367 | 360 | } |
| 368 | 361 | |
| @@ -385,14 +378,14 @@ | ||
| 385 | 378 | $verify = check_ajax_referer('vafpress', 'nonce', false); |
| 386 | 379 | if($verify) |
| 387 | 380 | { |
| 388 | 381 | $result['status'] = true; |
| 389 | - $result['message'] = __("Successful", 'wp-ultimate-post-grid'); | |
| 382 | + $result['message'] = __("Successful", 'wp-ultimate-recipe'); | |
| 390 | 383 | } |
| 391 | 384 | else |
| 392 | 385 | { |
| 393 | 386 | $result['status'] = false; |
| 394 | - $result['message'] = __("Unverified Access", 'wp-ultimate-post-grid'); | |
| 387 | + $result['message'] = __("Unverified Access", 'wp-ultimate-recipe'); | |
| 395 | 388 | } |
| 396 | 389 | return $result; |
| 397 | 390 | } |
| 398 | 391 | |
| @@ -456,9 +449,9 @@ | ||
| 456 | 449 | $template = include $this->get_template(); |
| 457 | 450 | else if(is_array($this->get_template())) |
| 458 | 451 | $template = $this->get_template(); |
| 459 | 452 | else |
| 460 | - throw new Exception(__( 'Invalid template supplied', 'wp-ultimate-post-grid' ), 1); | |
| 453 | + throw new Exception(__( 'Invalid template supplied', 'wp-ultimate-recipe' ), 1); | |
| 461 | 454 | |
| 462 | 455 | $parser = new VP_Option_Parser(); |
| 463 | 456 | $set = $parser->parse_array_options($template, $this->use_auto_group_naming()); |
| 464 | 457 | $set->set_layout($this->get_layout()); |
| @@ -469,15 +462,15 @@ | ||
| 469 | 462 | if( $this->use_util_menu() ) |
| 470 | 463 | { |
| 471 | 464 | // setup utility menu |
| 472 | 465 | $util_menu = new VP_Option_Control_Group_Menu(); |
| 473 | - $util_menu->set_title(__('Utility', 'wp-ultimate-post-grid')); | |
| 466 | + $util_menu->set_title(__('Utility', 'wp-ultimate-recipe')); | |
| 474 | 467 | $util_menu->set_name('menu_util'); |
| 475 | 468 | $util_menu->set_icon('font-awesome:fa-ambulance'); |
| 476 | 469 | |
| 477 | 470 | // setup restore default section |
| 478 | 471 | $restore_section = new VP_Option_Control_Group_Section(); |
| 479 | - $restore_section->set_title(__('Restore Default', 'wp-ultimate-post-grid')); | |
| 472 | + $restore_section->set_title(__('Restore Default', 'wp-ultimate-recipe')); | |
| 480 | 473 | $restore_section->set_name('section_restore'); |
| 481 | 474 | |
| 482 | 475 | // setup restore button |
| 483 | 476 | $restore_button = new VP_Option_Control_Field_Restore(); |
| @@ -484,9 +477,9 @@ | ||
| 484 | 477 | $restore_section->add_field($restore_button); |
| 485 | 478 | |
| 486 | 479 | // setup exim section |
| 487 | 480 | $exim_section = new VP_Option_Control_Group_Section(); |
| 488 | - $exim_section->set_title(__('Export/Import', 'wp-ultimate-post-grid')); | |
| 481 | + $exim_section->set_title(__('Export/Import', 'wp-ultimate-recipe')); | |
| 489 | 482 | $exim_section->set_name('section_exim'); |
| 490 | 483 | |
| 491 | 484 | // setup exim field |
| 492 | 485 | $exim_field = new VP_Option_Control_Field_ImpExp(); |