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
function worduoso_assets() { | |
wp_deregister_script('wr-pb-googlemap-js'); | |
wp_register_script( 'wr-pb-googlemap-js', 'https://maps.googleapis.com/maps/api/js?v=3.exp&key=API_KEY_FROM_GOOGLE', null, null, true ); | |
} | |
add_action('wp_enqueue_scripts', 'worduoso_assets', 10000); |
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
// ** MySQL settings - You can get this info from your web host ** // | |
/** The name of the database for WordPress */ | |
define('DB_NAME', 'your_database_name'); | |
/** MySQL database username */ | |
define('DB_USER', 'your_database_username'); | |
/** MySQL database password */ | |
define('DB_PASSWORD', 'your_database_password'); |
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 | |
/* | |
Plugin Name: My Custom Post Type | |
Description: Minimal code to add custom post type in a plugin | |
Version: 0.01 | |
Author: Myself | |
*/ | |
add_action( 'init', 'my_custom_plugin_create_post_type' ); |
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 custom widget to display ASIDE posts | |
*/ | |
class Worduoso_Aside_Widget extends WP_Widget { | |
function __construct() { | |
$widget_ops = array('classname' => 'widget_aside_posts', 'description' => __('Displays Latest Aside Posts')); | |
$this->WP_Widget('widget_worduoso_aside', "Aside Posts", $widget_ops); |
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 | |
/* | |
* exclude ASIDE format posts from the main loop | |
*/ | |
function worduoso_exclude_asides( $query ) { | |
if ( !is_admin() && $query->is_main_query() ) { | |
$query->tax_query->queries[] = array( | |
'taxonomy' => 'post_format', | |
'field' => 'slug', | |
'terms' => 'post-format-aside', |
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 | |
// The Query | |
$args = array( | |
'post_type' => 'post', | |
'posts_per_page' => 1, | |
); | |
$the_query = new WP_Query( $args ); | |
// now get random number and pull one random page (with one post per page) |
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
function gettext_filter($translation, $orig, $domain) { | |
switch($orig) { | |
case 'Username or Email Address': | |
$translation = "Student ID"; | |
break; | |
case 'Username': | |
$translation = "Student ID"; | |
break; | |
case 'Password': | |
$translation = 'Access Code'; |
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
/** | |
* add custom section to theme customizer (Appearance -> Customize) | |
*/ | |
function worduoso_customize_register($wp_customize) { | |
// add section to customizer | |
$wp_customize->add_section( 'worduoso' , array( | |
'title' => __('My Custom Section','worduoso'), | |
'priority' => 10, | |
)); |
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
add_filter('get_terms_args', 'wodruoso_terms_args', 10, 1); | |
function wodruoso_terms_args($args) { | |
if(is_admin() && isset($args["name__like"]) && !empty($args["name__like"])) { | |
$args["hide_empty"] = 0; | |
} | |
return $args; | |
} |
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 | |
function worduoso_editor_access() { | |
$role = get_role( 'editor' ); | |
$role->add_cap( 'gravityforms_view_entries' ); | |
$role->add_cap( 'gravityforms_view_entry_notes' ); | |
} | |
add_action( 'admin_init', 'worduoso_editor_access'); |
NewerOlder