Changeset 1703090
- Timestamp:
- 07/26/2017 12:40:13 PM (9 years ago)
- Location:
- adtechmedia/trunk
- Files:
-
- 3 edited
-
adtechmedia-optionsmanager.php (modified) (1 diff)
-
adtechmedia-plugin.php (modified) (5 diffs)
-
adtechmedia-request.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
adtechmedia/trunk/adtechmedia-optionsmanager.php
r1703025 r1703090 535 535 $plugin_meta_data_class = get_class( $this ) . '-data-settings-group'; 536 536 537 // Save Posted Options.538 if ( isset( $_POST['option_page'] )539 && isset( $_POST['_wpnonce'] )540 && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_wpnonce'] ) ), $main_data_class . '-options' )541 && sanitize_text_field( wp_unslash( $_POST['option_page'] ) ) == $main_data_class542 ) {543 $this->try_to_save_post( $main_data, $_POST );544 Adtechmedia_Request::property_update(545 $this->get_plugin_option( 'id' ),546 $this->get_plugin_option( 'support_email' ),547 $this->get_plugin_option( 'country' ),548 $this->get_plugin_option( 'key' )549 );550 $this->update_prop();551 } elseif ( isset( $_POST['option_page'] )552 && isset( $_POST['_wpnonce'] )553 && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_wpnonce'] ) ), $plugin_meta_data_class . '-options' )554 && sanitize_text_field( wp_unslash( $_POST['option_page'] ) ) == $plugin_meta_data_class555 ) {556 $this->try_to_save_post( $plugin_meta_data, $_POST );557 $this->update_prop();558 }559 560 537 Adtechmedia_Plugin::api_to_plugin_options(); 561 538 require_once 'views/admin.php'; 562 }563 564 /**565 * Try to save data from request566 *567 * @param array $options request data.568 * @param array $post request data.569 */570 public function try_to_save_post( $options, $post ) {571 if ( null != $options ) {572 foreach ( $options as $a_option_key => $a_option_meta ) {573 if ( isset( $post[ $a_option_key ] ) ) {574 $this->update_plugin_option( $a_option_key, $post[ $a_option_key ] );575 }576 }577 }578 539 } 579 540 -
adtechmedia/trunk/adtechmedia-plugin.php
r1703025 r1703090 342 342 343 343 /** 344 * Call function update_appearance after activation345 */346 public function one_update_appearance() {347 if ( ! empty( $this->get_plugin_option( 'key' ) ) ) {348 $this->update_appearance();349 $this->add_plugin_option( 'updated_appearance', 1 );350 }351 wp_die();352 }353 354 /**355 344 * The first init function Adtechmedia_AB 356 345 */ … … 462 451 // @codingStandardsIgnoreStart 463 452 if ( isset( $_POST['revenueMethod'], $_POST['country'] ) ) { 464 $plugin_dir = plugin_dir_path( __FILE__ );465 $file = $plugin_dir . '/js/atm.min.js';466 @unlink( $file );467 468 453 $revenue_method = sanitize_text_field( wp_unslash( $_POST['revenueMethod'] ) ); 469 454 $this->update_plugin_option( 'revenue_method', $revenue_method ); … … 475 460 $this->update_plugin_option( 'country', $country ); 476 461 477 Adtechmedia_Request::property_update_config_by_array(478 $this->get_plugin_option( 'id' ),479 $this->get_plugin_option( 'key' ),480 [481 'revenueMethod' => $revenue_method,482 ]483 );462 // Adtechmedia_Request::property_update_config_by_array( 463 // $this->get_plugin_option( 'id' ), 464 // $this->get_plugin_option( 'key' ), 465 // [ 466 // 'revenueMethod' => $revenue_method, 467 // ] 468 // ); 484 469 Adtechmedia_Request::property_update( 485 470 $this->get_plugin_option( 'id' ), … … 488 473 $this->get_plugin_option( 'key' ) 489 474 ); 490 Adtechmedia_ContentManager::clear_all_content(); 475 $this->update_prop(); 476 // Adtechmedia_ContentManager::clear_all_content(); 491 477 } else if ( isset( $_POST['contentConfig'] ) ) { 492 478 $content_config = json_decode( wp_unslash( $_POST['contentConfig'] ), true ); … … 504 490 echo 'ok'; 505 491 } 506 die(); 492 wp_die(); 493 } 494 495 /** 496 * Call function update_appearance after activation 497 */ 498 public function one_update_appearance() { 499 if ( ! empty( $this->get_plugin_option( 'key' ) ) ) { 500 $this->update_appearance(); 501 $this->add_plugin_option( 'updated_appearance', 1 ); 502 } 503 wp_die(); 507 504 } 508 505 -
adtechmedia/trunk/adtechmedia-request.php
r1703025 r1703090 292 292 $types = [ 293 293 'words' => 'words', 294 'paragraphs' => 'elements', 294 'paragraphs' => 'elements', // legacy... 295 'elements' => 'elements', 295 296 ]; 296 297 return $types[ $offset_type ];
Note: See TracChangeset
for help on using the changeset viewer.