芝麻web文件管理V1.00
编辑当前文件:/home/seolotod/critterchoice.com/wp-content/plugins/woozone/modules/product_report/init.php
the_plugin = $WooZone; $this->module_folder = $this->the_plugin->cfg['paths']['plugin_dir_url'] . 'modules/product_report/'; $this->module = $this->the_plugin->cfg['modules']['product_report']; if ( $this->the_plugin->is_admin ) { add_action('admin_menu', array( $this, 'adminMenu' )); } add_action( 'add_meta_boxes', array($this, 'product_report_meta_boxes') ); //add_action( 'wp_ajax_WooZoneAmzReport', array( $this, 'ajax_request' ) ); } //==================================================================================== //== AJAX REQUEST //==================================================================================== public function ajax_request() { $requestData = array( 'action' => isset($_REQUEST['sub_action']) ? (string) $_REQUEST['sub_action'] : '', ); extract($requestData); //var_dump('
', $requestData , '
'); echo __FILE__ . ":" . __LINE__;die . PHP_EOL; $ret = array( 'status' => 'invalid', 'msg' => 'Invalid action!', ); if ( empty($action) || !in_array($action, array( 'add_product', )) ) { die(json_encode($ret)); } //:: actions switch ( $action ) { } die( json_encode( $ret ) ); } // Hooks public function adminMenu() { if( isset($_REQUEST['post']) && isset($_REQUEST['action']) == 'edit' ) { wp_enqueue_script( 'WooZone/product_report', $this->module_folder . 'assets/product_report.js', array(), //'1.0&time=' . time(), '1.0', true ); wp_localize_script( 'WooZone/product_report', 'WooZoneProductReport', array( 'ajaxurl' => admin_url('admin-ajax.php') ) ); } } /** * Adds the meta box container. */ public function product_report_meta_boxes( $post_type ) { // Limit meta box to certain post types. $post_types = array( 'product' ); if ( in_array( $post_type, $post_types ) ) { add_meta_box( 'product_issue_report', __( '[WooZone] Report a problem', 'woozone' ), array( $this, 'render_meta_box_content' ), $post_type, 'normal', 'high' ); } } /** * Render Meta Box content. * * @param WP_Post $post The post object. */ public function render_meta_box_content( $post ) { // Add an nonce field so we can check for it later. //wp_nonce_field( 'woozone_product_issue_report', 'woozone_product_issue_report_nonce' ); // Use get_post_meta to retrieve an existing value from the database. $asin = get_post_meta( $post->ID, '_amzASIN', true ); // Display the form, using the current value. ?>
</textarea>