Oxilab Accordions › Home

Collect Accordions Shortcode, Edit, Delect, Clone or Export it.

admin_header(); $this->created_shortcode(); $this->create_new(); ?>
'oxi_accordions_ultimate', 'functionname' => 'shortcode_export', '_wpnonce' => wp_create_nonce('oxi_accordions_ultimate'), 'rawdata' => 'Get Export Data', 'styleid' => $template_id, ], admin_url('admin-ajax.php'), ); } public function created_shortcode() { $return = '
'; foreach ($this->database_data() as $value) { $id = $value['id']; $return .= _(''); $return .= _(''); $return .= _(''); $return .= _(''); $return .= _(''); $return .= _(' '); } $return .= _('
ID Name Shortcode Edit Delete
' . esc_html($id) . '' . esc_html(ucwords($value['name'])) . 'Shortcode   
' . 'Php Code   
Edit
Export


'); echo $return; } /** * Generate safe path * @since v2.0.1 */ public function safe_path($path) { $path = str_replace(['//', '\\\\'], ['/', '\\'], $path); return str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $path); } public function __construct() { $this->database = new \OXI_ACCORDIONS_PLUGINS\Helper\Database; $this->additional_load(); $this->public_render(); } public function additional_load() { $this->database_data(); $this->admin_front_additional(); $this->manual_import_json(); apply_filters('oxi-accordions-plugin/admin_menu', true); } /** * Plugin Name Convert to View * * @since 2.0.1 */ public function name_converter($data) { $data = str_replace('tyle', 'tyle ', $data); return ucwords($data); } public function create_new() { echo '
'; echo ' '; echo ''; } public function manual_import_json() { if (!empty($_REQUEST['_wpnonce'])) { $nonce = $_REQUEST['_wpnonce']; } if (!empty($_POST['importdatasubmit']) && sanitize_text_field($_POST['importdatasubmit']) == 'Save') { if (!wp_verify_nonce($nonce, 'oxi-accordions-ultimate-import')) { die('You do not have sufficient permissions to access this page.'); } else { if (isset($_FILES['importaccordionsfile'])) : if (!current_user_can('upload_files')) : wp_die(esc_html('You do not have permission to upload files.')); endif; $allowedMimes = [ 'json' => 'text/plain' ]; $fileInfo = wp_check_filetype(basename($_FILES['importaccordionsfile']['name']), $allowedMimes); if (empty($fileInfo['ext'])) { wp_die(esc_html('You do not have permission to upload files.')); } $content = json_decode(file_get_contents($_FILES['importaccordionsfile']['tmp_name']), true); if (empty($content)) { return new \WP_Error('file_error', 'Invalid File'); } $style = $content['style']; if (!is_array($style) || $style['type'] != 'accordions-or-faqs') { return new \WP_Error('file_error', 'Invalid Content In File'); } $ImportApi = new \OXI_ACCORDIONS_PLUGINS\Classes\API(); $new_slug = $ImportApi->post_json_import($content); echo ''; exit; endif; } } } public function database_data() { return $this->database->wpdb->get_results($this->database->wpdb->prepare('SELECT * FROM ' . $this->database->parent_table . ' WHERE type = %s ', 'accordions-or-faqs'), ARRAY_A); } }