Vip Tools
No content found.
READY /** * Plugin Name: ToolSuite Pro * Plugin URI: https://viptools.pk/ * Description: Turn Your WordPress Site Into a Scalable, SEO-Optimized Tool Powerhouse. Easily create, manage, monetize, and scale 100+ interactive web tools. Developed by MrWaseem. * Version: 4.0.0 * Author: MrWaseem * Author URI: https://github.com/Waseemuxui * Text Domain: toolsuite-pro * License: GPLv2 or later */ if (!defined('ABSPATH')) { exit; } define('TOOLSUITE_PRO_PATH', plugin_dir_path(__FILE__)); define('TOOLSUITE_PRO_URL', plugin_dir_url(__FILE__)); // Require Core Files require_once TOOLSUITE_PRO_PATH . 'includes/tools-library.php'; require_once TOOLSUITE_PRO_PATH . 'includes/admin-settings.php'; /** * Register Custom Post Type 'tool' & Custom Taxonomy 'tool_category' */ function toolsuite_pro_register_cpt() { // Taxonomy $tax_labels = array( 'name' => _x('Tool Categories', 'taxonomy general name', 'toolsuite-pro'), 'singular_name' => _x('Tool Category', 'taxonomy singular name', 'toolsuite-pro'), 'search_items' => __('Search Categories', 'toolsuite-pro'), 'all_items' => __('All Categories', 'toolsuite-pro'), 'edit_item' => __('Edit Category', 'toolsuite-pro'), 'update_item' => __('Update Category', 'toolsuite-pro'), 'add_new_item' => __('Add New Category', 'toolsuite-pro'), 'new_item_name' => __('New Category Name', 'toolsuite-pro'), 'menu_name' => __('Categories', 'toolsuite-pro'), ); register_taxonomy('tool_category', array('tool'), array( 'hierarchical' => true, 'labels' => $tax_labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array('slug' => 'category'), 'show_in_rest' => true, )); // Custom Post Type $cpt_labels = array( 'name' => _x('ToolSuite Pro', 'Post type general name', 'toolsuite-pro'), 'singular_name' => _x('Tool', 'Post type singular name', 'toolsuite-pro'), 'menu_name' => _x('ToolSuite Pro', 'Admin Menu text', 'toolsuite-pro'), 'name_admin_bar' => _x('Tool', 'Add New on Toolbar', 'toolsuite-pro'), 'add_new' => __('Add New Tool', 'toolsuite-pro'), 'add_new_item' => __('Add New Interactive Tool', 'toolsuite-pro'), 'new_item' => __('New Tool', 'toolsuite-pro'), 'edit_item' => __('Edit Tool Engine', 'toolsuite-pro'), 'view_item' => __('View Tool Live', 'toolsuite-pro'), 'all_items' => __('All Tools', 'toolsuite-pro'), 'search_items' => __('Search Tools', 'toolsuite-pro'), ); register_post_type('tool', array( 'labels' => $cpt_labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => array('slug' => '%tool%', 'with_front' => false), 'capability_type' => 'post', 'has_archive' => 'tools', 'hierarchical' => false, 'menu_position' => 5, 'menu_icon' => 'dashicons-admin-tools', 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'custom-fields'), 'show_in_rest' => true, )); } add_action('init', 'toolsuite_pro_register_cpt'); /** * Remove /tool/ prefix from tool permalinks */ function toolsuite_pro_remove_cpt_slug($post_link, $post) { if ('tool' === $post->post_type && 'publish' === $post->post_status) { return home_url('/' . $post->post_name . '/'); } return $post_link; } add_filter('post_type_link', 'toolsuite_pro_remove_cpt_slug', 10, 2); /** * Add rewrite rules for clean root-level tool permalinks */ function toolsuite_pro_add_cpt_rewrite_rules($wp_rewrite) { $rules = array(); $posts = get_posts(array( 'post_type' => 'tool', 'post_status' => 'publish', 'posts_per_page' => -1, )); foreach ($posts as $post) { $rules[$post->post_name . '/?$'] = 'index.php?tool=' . $post->post_name; } $wp_rewrite->rules = $rules + $wp_rewrite->rules; } add_action('generate_rewrite_rules', 'toolsuite_pro_add_cpt_rewrite_rules'); /** * Add Tool Meta Boxes (Custom HTML/CSS/JS Engine Code & Icons) */ function toolsuite_pro_add_meta_boxes() { add_meta_box( 'toolsuite_code_engine', '⚙️ ToolSuite Pro Custom Code Engine (HTML / CSS / JS)', 'toolsuite_pro_code_engine_meta_box', 'tool', 'normal', 'high' ); } add_action('add_meta_boxes', 'toolsuite_pro_add_meta_boxes'); function toolsuite_pro_code_engine_meta_box($post) { $icon = get_post_meta($post->ID, '_tool_icon', true) ?: 'fas fa-wrench'; $custom_html = get_post_meta($post->ID, '_tool_custom_html', true); $custom_css = get_post_meta($post->ID, '_tool_custom_css', true); $custom_js = get_post_meta($post->ID, '_tool_custom_js', true); wp_nonce_field('toolsuite_meta_box_nonce', 'toolsuite_meta_nonce'); ?>
Tool Icon Class (FontAwesome / SVG URL):
Custom HTML Markup (Overrides default layout):
Custom CSS Code:
Custom JS Logic:
No content found.