@@ 533-545 (lines=13) @@ | ||
530 | * |
|
531 | * @since 2.7 |
|
532 | */ |
|
533 | public function activate_component( $component ) { |
|
534 | ||
535 | if ( ! $this->is_component_active( $component ) ) { |
|
536 | if ( isset( $this->components[ $component ] ) ) { |
|
537 | $this->settings[ 'components' ][ $component ] = array(); |
|
538 | ||
539 | $settings = version_compare( PHP_VERSION, '5.4.0', '>=' ) ? json_encode( $this->settings, JSON_UNESCAPED_UNICODE ) : json_encode( $this->settings ); |
|
540 | ||
541 | update_option( 'pods_component_settings', $settings ); |
|
542 | } |
|
543 | } |
|
544 | ||
545 | } |
|
546 | ||
547 | /** |
|
548 | * Deactivate a component |
|
@@ 554-566 (lines=13) @@ | ||
551 | * |
|
552 | * @since 2.7 |
|
553 | */ |
|
554 | public function deactivate_component( $component ) { |
|
555 | ||
556 | if ( $this->is_component_active( $component ) ) { |
|
557 | if ( isset( $this->components[ $component ] ) ) { |
|
558 | $this->settings[ 'components' ][ $component ] = 0; |
|
559 | ||
560 | $settings = version_compare( PHP_VERSION, '5.4.0', '>=' ) ? json_encode( $this->settings, JSON_UNESCAPED_UNICODE ) : json_encode( $this->settings ); |
|
561 | ||
562 | update_option( 'pods_component_settings', $settings ); |
|
563 | } |
|
564 | } |
|
565 | ||
566 | } |
|
567 | ||
568 | /** |
|
569 | * Toggle a component on or off |