key = 'dfrapi_export'; add_action( 'admin_init', array( &$this, 'register_settings' ) ); add_action( 'admin_menu', array( $this, 'admin_menu' ) ); } function admin_menu() { add_submenu_page( 'dfrapi', __( 'Export — Datafeedr API', DFRAPI_DOMAIN ), __( 'Export', DFRAPI_DOMAIN ), 'manage_options', $this->key, array( $this, 'output' ) ); } function output() { echo '
'; echo '

' . dfrapi_setting_pages( $this->page ) . ' — Datafeedr API

'; settings_fields( $this->page ); do_settings_sections( $this->page); echo '
'; } function register_settings() { register_setting( $this->page, $this->key, array( $this, 'validate' ) ); add_settings_section( 'export_network_data', __( 'Network Data', DFRAPI_DOMAIN ), array( &$this, 'section_export_network_data' ), $this->page ); add_settings_section( 'export_merchant_data', __( 'Merchant Data', DFRAPI_DOMAIN ), array( &$this, 'section_export_merchant_data' ), $this->page ); } function section_export_network_data() { $network_settings = (array) get_option( 'dfrapi_networks' ); echo '

' . __( 'To use the same selection of networks on another website, export this store\'s network data by copying the code below. Paste the code into the Import page of your other site.' ) . '

'; echo ''; echo '

' . __( 'Click within the box to select all your networks and affiliate IDs.' ) . '

'; } function section_export_merchant_data() { $merchant_settings = (array) get_option( 'dfrapi_merchants' ); echo '

' . __( 'To use the same selection of merchants on another website, export this store\'s merchant data by copying the code below. Paste the code into the Import page of your other site.' ) . '

'; echo ''; echo '

' . __( 'Click within the box to select all your merchant IDs.' ) . '

'; } function validate( $input ) { return $input; } } // class Dfrapi_Export } // class_exists check