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
function register_post_types() { | |
//this is where you can register custom post types | |
function custom_posts($name, $single, $menu_order, $meta_cap, $capability_type, $supports, $taxonomies) { | |
register_post_type( $name, array( | |
'labels' => array( | |
'name' => _x( ucfirst($name), 'Post Type General Name', 'text_domain' ), | |
'singular_name' => _x( ucfirst($single), 'Post Type Singular Name', 'text_domain' ), | |
'menu_name' => __( ucfirst($name), 'text_domain' ), | |
'name_admin_bar' => __( ucfirst($name), 'text_domain' ), | |
), |
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
UPDATE `--database-name--`.wp_users SET user_pass = md5('--type the new password here--') WHERE user_login = 'pixel'; |
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
$groups = acf_get_local_field_groups(); | |
$json = []; | |
foreach ($groups as $group) { | |
// Fetch the fields for the given group key | |
$fields = acf_get_local_fields($group['key']); | |
// Remove unecessary key value pair with key "ID" | |
unset($group['ID']); |
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
$groups = acf_get_local_field_groups(); | |
$json = []; | |
foreach ($groups as $group) { | |
// Fetch the fields for the given group key | |
$fields = acf_get_local_fields($group['key']); | |
// Remove unecessary key value pair with key "ID" | |
unset($group['ID']); |
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
function custom_meta_box_markup() | |
{ | |
// custom meta box markup goes here | |
} | |
function add_custom_meta_box() | |
{ | |
add_meta_box("demo-meta-box", "Custom Meta Box", "custom_meta_box_markup", "post", "side", "high", null); | |
} |
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
define( 'DISALLOW_FILE_EDIT', true ); |
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
# Restrict direct access to PHP files from theme or plugin directories | |
# Place in root .htaccess file | |
# Restrict direct access to PHP files from plugin directories | |
RewriteCond %{REQUEST_URI} !^/wp-content/plugins/file/to/exclude\.php | |
RewriteCond %{REQUEST_URI} !^/wp-content/plugins/directory/to/exclude/ | |
RewriteRule wp-content/plugins/(.*\.php)$ - [R=404,L] |
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 | |
// Sets the user's display name (always) to first name last name, when it's avail. | |
add_action ('admin_head','make_display_name_f_name_last_name'); | |
function make_display_name_f_name_last_name(){ | |
$users = get_users(array('fields'=>'all')); | |
foreach($users as $user){ | |
$user = get_userdata($user->ID); |
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 | |
/* | |
* Paginate Advanced Custom Field repeater | |
*/ | |
if( get_query_var('page') ) { | |
$page = get_query_var( 'page' ); | |
} else { | |
$page = 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
function my_custom_search_filter( $query ) { | |
if ( $query->is_search ) { | |
$query->set( 'post_type', array('post','page') ); | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts','my_custom_search_filter'); |
NewerOlder