_helper() { return $this->services['shortcodes_helper']; } /** * @return ATDTP_Storage_Installer */ public function storage_installer() { if ( empty( $this->services['storage_installer'] ) ) { $this->require_file( '/classes/ATDTP_Storage_Installer.php' ); $this->services['storage_installer'] = new ATDTP_Storage_Installer(); } return $this->services['storage_installer']; } /** * Requires plugin file by it relative path. * * @param string $local_path * @return void */ public function require_file( $local_path ) { $full_path = dirname( __FILE__ ) . $local_path; //if ( ! file_exists( $full_path ) ) return; require $full_path; } /** * Loads and inits all related services. * * @return void */ protected function init() { $this->require_file( '/classes/ATDTP_Data_Types_Registrator.php' ); $this->require_file( '/classes/ATDTP_Shortcodes_Helper.php' ); $this->require_file( '/classes/ATDTP_Shortcodes_Visual_Composer.php' ); $this->services['data_registrator'] = new ATDTP_Data_Types_Registrator(); $this->services['shortcodes_helper'] = new ATDTP_Shortcodes_Helper(); $this->services['visual_composer_shortcodes_helper'] = new ATDTP_Shortcodes_Visual_Composer(); add_action( 'plugins_loaded', array( $this, 'load_textdomain') ); register_activation_hook( __FILE__, array( $this, 'hook_plugin_activation' ) ); register_deactivation_hook( __FILE__, array( $this, 'hook_plugin_deactivation' ) ); add_action( 'wp_enqueue_scripts', array( $this, 'action_load_assets' ) ); } /** * Load plugin textdomain. * * @return void */ public function load_textdomain() { load_plugin_textdomain( 'adventure-tours-data-types', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); } public function hook_plugin_activation() { if ( ! $this->check_rights_for_use_plugin() ) { return; } $this->storage_installer()->do_install(); } public function hook_plugin_deactivation() { if ( ! $this->check_rights_for_use_plugin() ) { return; } } public function action_load_assets() { // If plugin used with main theme - default styles are not required. if ( function_exists( 'adventure_tours_init_theme_asserts' ) ) { return; } wp_enqueue_style( 'atdtp-plugin-shortcodes', $this->get_plugin_url() . 'assets/css/style.css', null, $this->version ); wp_enqueue_style( 'atdtp-plugin-font-awesome', $this->get_plugin_url() . 'assets/css/font-awesome.min.css', null, $this->version ); } public function get_plugin_url() { return plugin_dir_url( __FILE__ ); } /** * Constructor. */ protected function __construct() { } /** * Clone if forbidden. * * @return void */ private function __clone() { } /** * Unserialize if forbidden. * * @return void */ private function __wakeup() { } private function check_rights_for_use_plugin() { $result = false; if ( current_user_can( 'activate_plugins' ) ) { $result = true; } return $result; } } /** * @return ATDTP */ function ATDTP() { return ATDTP::instance(); } define( 'ATDTP_PATH', dirname( __FILE__ ) ); ATDTP(); // To init plugin. pdb->prefix . "contact_form_7"; if ( $wpdb->get_var( "SHOW TABLES LIKE '$table_name'" ) ) { $old_rows = $wpdb->get_results( "SELECT * FROM $table_name" ); } elseif ( ( $opt = get_option( 'wpcf7' ) ) && ! empty( $opt['contact_forms'] ) ) { foreach ( (array) $opt['contact_forms'] as $key => $value ) { $old_rows[] = (object) array_merge( $value, array( 'cf7_unit_id' => $key ) ); } } foreach ( (array) $old_rows as $row ) { $q = "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_old_cf7_unit_id'" . $wpdb->prepare( " AND meta_value = %d", $row->cf7_unit_id ); if ( $wpdb->get_var( $q ) ) { continue; } $postarr = array( 'post_type' => 'wpcf7_contact_form', 'post_status' => 'publish', 'post_title' => maybe_unserialize( $row->title ), ); $post_id = wp_insert_post( $postarr ); if ( $post_id ) { update_post_meta( $post_id, '_old_cf7_unit_id', $row->cf7_unit_id ); $metas = array( 'form', 'mail', 'mail_2', 'messages', 'additional_settings' ); foreach ( $metas as $meta ) { update_post_meta( $post_id, '_' . $meta, wpcf7_normalize_newline_deep( maybe_unserialize( $row->{$meta} ) ) ); } } } } add_action( 'wpcf7_upgrade', 'wpcf7_prepend_underscore', 10, 2 ); function wpcf7_prepend_underscore( $new_ver, $old_ver ) { if ( version_compare( $old_ver, '3.0-dev', '<' ) ) { return; } if ( ! version_compare( $old_ver, '3.3-dev', '<' ) ) { return; } $posts = WPCF7_ContactForm::find( array( 'post_status' => 'any', 'posts_per_page' => -1, ) ); foreach ( $posts as $post ) { $props = $post->get_properties(); foreach ( $props as $prop => $value ) { if ( metadata_exists( 'post', $post->id(), '_' . $prop ) ) { continue; } update_post_meta( $post->id(), '_' . $prop, $value ); delete_post_meta( $post->id(), $prop ); } } }
Parse error: syntax error, unexpected ''' (T_ENCAPSED_AND_WHITESPACE), expecting ')' in /var/www/html/thread9003/catba.goodtour.vn/public_html/wp-content/plugins/js_composer/include/helpers/helpers.php on line 112