This file contains hidden or 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 | |
| add_action( 'wp_enqueue_scripts', 'mytheme_scripts' ); | |
| /** | |
| * Enqueue Dashicons style for frontend use | |
| */ | |
| function mytheme_scripts() { | |
| wp_enqueue_style( 'dashicons' ); | |
| } |
This file contains hidden or 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 | |
| add_action( 'wp_enqueue_scripts', 'mytheme_scripts' ); | |
| /** | |
| * Enqueue Dashicons style for frontend use when enqueuing your theme's style sheet | |
| */ | |
| function mytheme_scripts() { | |
| wp_enqueue_style( 'mytheme-style', get_stylesheet_uri(), 'dashicons' ); | |
| } |
This file contains hidden or 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 | |
| add_filter( 'cac/storage_models', 'myplugin_cpac_storage_models' ); | |
| function myplugin_cpac_storage_models( $storage_models ) { | |
| if ( isset( $storage_models['mycpt'] ) ) { | |
| unset( $storage_models['mycpt'] ); | |
| } | |
| return $storage_models; | |
| } |
This file contains hidden or 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
| /* | |
| Plugin Name: Admin Columns - Yoast SEO Title Column Editability | |
| Version: 1.0 | |
| Author URI: AUTHOR_URL | |
| License: GPLv2 or later | |
| License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
| */ | |
| add_filter( 'cac/editable/is_column_editable/column=wpseo-title', '__return_true' ); | |
| add_filter( 'cac/editable/editables_data', 'my_plugin_column_seo_title_editability', 10, 2 ); |
This file contains hidden or 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
| /** | |
| * Retrieve the array key corresponding to the largest element in the array. | |
| * | |
| * @param {Array.<number>} array Input array | |
| * @return {number} Index of array element with largest value | |
| */ | |
| function argMax(array) { | |
| return array.map((x, i) => [x, i]).reduce((r, a) => (a[0] > r[0] ? a : r))[1]; | |
| } |
OlderNewer