Posts

changes into code

<?php /** * Plugin Shortcode Class File. * * handels wordpress site global search accross posts, pages, cpt etc. * * @since 1.0.0 * @package Website_Search */ if (!defined('ABSPATH')) { exit; } class Website_Search_Shortcode { /** * Constructor. * * loads all the shortcode related dependencies, get search results * * @since 1.0.0 * @return void */ public function __construct() { add_shortcode('website_search', [$this, 'sdw_website_search_short_code_callback']); add_action('posts_search', [$this, 'sdw_get_taxonomy_meta_callback'], 10, 2); add_filter('template_include', [$this, 'sdw_load_website_search_template']); add_action('init', [$this, 'sdw_register_search_rewrite']); add_filter('query_vars', [$this, 'sdw_register_query_vars']); add_action('pre_get_posts', [$this, 'sdw_map_q_to_search']); } public function sdw_register_search_rewrite() { add_rewrite_rule( '^search/content/...

wordpress plugin boilerplate

  Ideal Folder Structure (Industry-standard) log -manager/ │ ├── log -manager.php (Main plugin file) │ ├── includes/ │ ├── class - log -manager.php │ ├── class - log -manager- admin .php │ ├── class - log -manager-logger.php │ └── class - log -manager-db.php │ ├── assets/ │ ├── css/ │ └── js/ │ └── uninstall.php 1️⃣ Main Plugin File ( log-manager.php ) 👉 ONLY bootstraps the plugin <?php /** * Plugin Name: Log Manager * Description: WordPress Log Manager Plugin * Version: 1.0.0 */ if (! defined ( 'ABSPATH' )) exit ; define ( 'LM_PATH' , plugin_dir_path ( __FILE__ )); define ( 'LM_URL' , plugin_dir_url ( __FILE__ )); require_once LM_PATH . 'includes/class-log-manager.php' ; function run_log_manager ( ) { $plugin = new Log_Manager (); $plugin -> run (); } run_log_manager (); 2️⃣ Core Plugin Class ( class-log-manager.php ) 👉 Controls everything <?php class Log_Manager { public functio...

graphql mutation in wpgraphql

 mutation MyMutation {   registerUser(     input: {username: "abacus", email: "abacus@gmail.com", password: "abacus123", firstName: "abacusjames", lastName: "nito"}   ) {     user {       auth {         authToken         refreshToken         authTokenExpiration         refreshTokenExpiration       }       id       email       roles {         nodes {           name         }       }     }   } } =========================================== contact form 7 submission with rate limiter ===>  add_action('rest_api_init', function () {     register_rest_route('wp/v2', '/cf7/submit', array(         'methods'  => 'POST',         'callback' => 'mcbot_...

Donation

Image
 Hi user! If you appriciate my work , then you can send me welcome gift!  Meme template https://drive.google.com/drive/folders/11tu9TcU9_fxWI9h-2zKvXUux9yiH8rlz as  now, in india , we only focuses on UPI payment! If you have any quqery! then whatsapp me: 9330497982 if you want to donate me via Google Pay or any UPI App then scan the below link and payout to me!

STRAPI

Image
  Strapi helps us to provide pre-made cms backend. In strapi everything is about content type.   Topic: Weird Things About STRAPI Topic: Document Save States When we want to store a post into strapi, that time it gives us 2 options: “publish”, “save”. When we create content as publish/save it creates 2 different records. First 2 are for “save” and the rest 2 are for “publish”. Good thing is when creating a new publish/save it delta the OLD one ID and create a NEW one. Topic: Content Type change in strapi We can add multiple fields into strapi content type. For changing the Column Type we need go in inside /src/your-content-type/schema.json /* OLD ONE */ "attributes": {     "title": {       "type": "string"     },     "description": {       "type": "text",   "length": 80     }, /* NEW ONE */ "description": {    ...