This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$my_metabox = new My_Best_Metaboxes( 'post' ); | |
$my_metabox->init(); | |
class My_Best_Metaboxes { | |
public $post_type; | |
static $meta_prefix = 'company_address'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Disable forced checking for new WP, plugins, and theme versions in the admin panel, | |
* so that it doesn't slow down when you haven't visited for a long time and then visit... | |
* All checks will happen unnoticed through cron or when you visit the "Dashboard > Updates" page. | |
* | |
* @see https://wp-kama.ru/filecode/wp-includes/update.php | |
* @author Kama (https://wp-kama.ru) | |
* @version 1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gathers and caches the minimum and maximum value of the specified meta-field for the specified terms of the taxonomy. | |
* Suitable for obtaining the minimum and maximum prices of products from categories. | |
* | |
* The code caches the minimum and maximum numerical values in the post meta-fields for each category. | |
* It also collects the overall minimum and maximum values for the entire taxonomy. | |
* | |
* @changelog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if( ! is_admin() ){ | |
return; | |
} | |
add_action( 'admin_init', [ Kama_Post_List_Table_Thumb::class, 'init' ] ); | |
/** | |
* Ability to upload and modify post thumbnails from the posts list table in the admin panel. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* \t (tab ⇆ tabulation) symbol in textarea when pressing tab on the keyboard. | |
* | |
* Adds initial indentation for selected text when pressing the `Tab` key. | |
* Or removes the initial indentation (4 spaces or TAB) when pressing `Shift + Tab`. | |
* | |
* @Author Kama (wp-kama.ru) | |
* @version 4.3 | |
*/ | |
document.addEventListener( 'keydown', function( event ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*** | |
* Disables Gutenberg (the new block editor in WordPress). | |
* | |
* @version 2.0 | |
*/ | |
did_action( 'plugins_loaded' ) | |
? Kama_Disable_Gutenberg::init() | |
: add_action( 'plugins_loaded', [ Kama_Disable_Gutenberg::class, 'init' ] ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Предыдущие записи из рубрики (относительно текущей записи) + | |
* кольцевая перелинковка (можно указывать таксономию и тип записи). | |
* | |
* Кэширует результат в объектный кэш, если он включен. | |
* | |
* Вызываем функцию так: | |
* | |
* echo kama_previous_posts_from_tax_lis( [ | |
* 'post_num' => 5, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Previous posts from the category (relative to the current post) + circular linking | |
* Parameters passed to the function. Default values are indicated in parentheses. | |
* | |
* @param int $post_num (5) Number of links. | |
* @param string $format ('') Output format: `{thumb} {date:j.M.Y} - {a}{title}{/a} ({comments})`. | |
* @param string $cache ('') Enable cache (default is off). Write 1 to enable. | |
* @param string $list_tag (li) List tag. | |
* @param string $post_type (post) Type of post we are working with. |
NewerOlder