'.__('Settings','atp-cn').''; array_unshift($links, $settings_link); return $links; } public function ATP_CN_add_plugin_links($links, $file) { if ( $file == plugin_basename(dirname(__FILE__).'/ATP-Call-Now.php') ) { $links[] = '' . esc_html__('Documents', 'atp-cn') . ''; } return $links; } public function ATP_CN_scripts_and_styles() { wp_deregister_style( 'atp-cn-style-css' ); wp_register_style( 'atp-cn-style-css', plugins_url( '/css/style.css', __FILE__ )); wp_enqueue_style( 'atp-cn-style-css' ); } public function ATP_CN_admin_scripts_and_styles() { wp_enqueue_media(); //run wp.media button wp_register_script('atp-pa-script-js', plugins_url('/js/script.js', __FILE__ ), array('jquery')); wp_enqueue_script('atp-pa-script-js'); } public function ATP_CN_get_version() { $plugin_data = get_plugin_data( __FILE__ ); $plugin_version = $plugin_data['Version']; return $plugin_version; } public function ATP_CN_register_settings() { register_setting( 'ATP_CN_settings_group', 'atpcn_page_id');register_setting( 'ATP_CN_settings_group', 'atpcn_link' ); register_setting('ATP_CN_settings_group','atpcn_text');register_setting( 'ATP_CN_settings_group', 'atpcn_left_right' ); register_setting('ATP_CN_settings_group','atpcn_bottom_top');register_setting('ATP_CN_settings_group', 'atpcn_hide_pc' ); register_setting( 'ATP_CN_settings_group', 'atpcn_hide_mb');register_setting( 'ATP_CN_settings_group', 'atpcn_image_url'); register_setting( 'ATP_CN_settings_group', 'atpcn_size');register_setting( 'ATP_CN_settings_group', 'atpcn_long'); register_setting( 'ATP_CN_settings_group', 'atpcn_color');register_setting( 'ATP_CN_settings_group', 'atpcn_color_bg'); register_setting( 'ATP_CN_settings_group', 'atpcn_color_text'); } public function ATP_CN_create_menu() { add_menu_page(__('ATP Call Now Settings','atp-cn'),__('ATP Call Now','atp-cn'), 'manage_options', 'ATP-Call-Now', array( $this, 'ATP_CN_settings_page' ), plugins_url('/img/telephone-20x20.png', __FILE__), 30); } public function ATP_CN_settings_page() { if( isset($_GET['settings-updated']) ) { echo '

'.__('Saved!','atp-cn').'

';} echo '

'.__('ATP Call Now Settings','atp-cn').' ('.__('Version','atp-cn').' '.$this->ATP_CN_get_version().')

'; settings_fields( 'ATP_CN_settings_group' ); echo '
';?>
'; submit_button(); echo '
';?> '; } public function ATP_Call_Now() { $atpcn_hide_pc = get_option('atpcn_hide_pc');$atpcn_hide_mb = get_option('atpcn_hide_mb'); $atpcn_link = get_option("atpcn_link");$atpcn_image_url = get_option("atpcn_image_url"); $atpcn_text = get_option("atpcn_text");$atpcn_size = get_option("atpcn_size"); $atpcn_left_right = get_option("atpcn_left_right");$atpcn_bottom_top = get_option("atpcn_bottom_top"); $atpcn_long = get_option("atpcn_long");$atpcn_color = get_option("atpcn_color"); $atpcn_color_bg = get_option("atpcn_color_bg");$atpcn_color_text = get_option("atpcn_color_text"); if ($atpcn_link == "" || $atpcn_link == NULL) { $atpcn_link = "0931999911"; } if ($atpcn_image_url == "" || $atpcn_image_url == NULL) { $atpcn_image_url = plugins_url('/img/telephone.png', __FILE__); } if ($atpcn_text == "" || $atpcn_text == NULL) { $atpcn_text = "Đặt mua"; } if ($atpcn_size == "" || $atpcn_size == NULL) { $atpcn_size = 50; } if ($atpcn_color == "" || $atpcn_color == NULL) { $atpcn_color = "#0089B9"; } if ($atpcn_color_bg == "" || $atpcn_color_bg == NULL) { $atpcn_color_bg = "#ffff00"; } if ($atpcn_color_text == "" || $atpcn_color_text == NULL) { $atpcn_color_text = "#000000"; } if ($atpcn_left_right == "" || $atpcn_left_right == NULL) { $atpcn_left_right = "left"; } if ($atpcn_bottom_top == "" || $atpcn_bottom_top == NULL) { $atpcn_bottom_top = "bottom"; } if ($atpcn_long == "" || $atpcn_long == NULL) { $atpcn_long = 25; } if($atpcn_hide_pc == 1) { $atpcn_show_hide_pc = "none"; } else { $atpcn_show_hide_pc = "block"; } if($atpcn_hide_mb == 1) { $atpcn_show_hide_mb = "none"; } else { $atpcn_show_hide_mb = "block"; } $atpcn_page_id = esc_attr (get_option ( 'atpcn_page_id' )); if ( ! empty( $atpcn_page_id ) ) { $atpcn_page_id = explode( ',', $atpcn_page_id ); } if ( is_page( $atpcn_page_id ) ) { echo ''; } else { echo ''; } ?>