Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

五月 26, 2022 • 沒有評論 Javascript Plugin Starter Template

Javascript File // plugin.js function GoogleSearchMePlugin(options) { let defaultOptions = { base_url: "https://www.google.com/?q=", keyword: "imnobby",...

閱讀內文
五月 25, 2022 • 沒有評論 PHP Simple HTTP Get Function

function imnobby_simple_http_get($url){ $curl = curl_init(); if (!$curl) { die("Couldn't initialize a cURL handle"); } curl_setopt($curl,...

閱讀內文
五月 25, 2022 • 沒有評論 WordPress Admin Ajax Example Script

// Put in functions.php function imnobby_ajax_get_data(){ // Endpoint: /wp-admin/admin-ajax.php?action=imnobby_ajax_get_data $tmphtml = 'produce some output here';...

閱讀內文
五月 25, 2022 • 沒有評論 Javascript Random Key Generator

function js_random_key_generator(length) { var result = ''; var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; var charactersLength = characters.length;...

閱讀內文
五月 25, 2022 • 沒有評論 WordPress Standard Add Shortcode Function

function do_imnobby_standard_wp_shortcode($attr){ $tmphtml = ''; $tmphtml .= $attr["showtext"]; return $tmphtml; } add_shortcode( 'imnobby_standard_wp_shortcode', 'do_imnobby_standard_wp_shortcode' );...

閱讀內文
五月 23, 2022 • 沒有評論 WordPress Post Category Filter in Home Page

function imnobby_home_page_post_filter($query){ if($query->is_home() && $query->is_main_query()) { $query->set('cat', '-72'); // get_the_ID('codedb'); } } add_action('pre_get_posts', 'imnobby_home_page_post_filter');…

閱讀內文