Admin or login to a site:
/admin
For some webhosts, inc. Media Temple:
/wp-admin
All Settings list (wp_options database table):
/wp-admin/options.php
Jetpack modules settings (old admin page):
/wp-admin/admin.php?page=jetpack_modules
<?php | |
/* List GUIDs of all files of specified mime-type in Media Library. */ | |
$query_images_args = array( | |
'post_type' => 'attachment', | |
'post_status' => 'inherit', | |
'post_mime_type' => 'application/pdf', // Only PDFs. | |
'posts_per_page' => -1, | |
); | |
$query_images = new WP_Query( $query_images_args ); | |
print_r( wp_list_pluck( $query_images->posts, 'guid' ) ); |
<?php | |
/** | |
* Add files to Media Library; attach files to posts. | |
* | |
* This is for adding files to Media Library already in /uploads/. | |
* If files are elsewhere, adapt script. | |
* | |
* Attempts to attach file to post: | |
* Searches thru post content for the filename. | |
* If a post is found, then uses post ID and publish-date |
<?php | |
/** | |
* Use filemod timestamp for version number. | |
* | |
* For setting cache-busting version number in script registrations. Usage: | |
* wp_register_script( 'handle', $file_url, array(), headecon_filemod_vers( $file_path ) ); | |
* | |
* @param string $path Path of script/style file | |
* @return string $vers File-modification timestamp or WordPress version | |
*/ |
<?php | |
/** | |
* Insert class into body tag for highest level Category or Page. | |
* | |
* Pages and Categories with identical slugs get the same class. | |
* Works on Pages, Posts, and Category achives. | |
* | |
* @return string $top_slug Class name for body tag. | |
*/ | |
function top_cat_or_page_body_class( $class ) { |
<?php | |
/******************************* | |
=Comments: Remove | |
******************************/ | |
/* Remove comments support from native post types | |
* | |
* Removes Comments column from admin post lists and Comments meta-box from Edit Post. | |
*/ | |
function headecon_remove_comments() { | |
remove_post_type_support( 'post', 'comments' ); |
<?php | |
/** | |
* Shortcode accesses external database and returns data in HTML table. | |
* | |
* Shortcode is: [my-db-data]. | |
* Uses WP class: | |
* @link https://developer.wordpress.org/reference/classes/wpdb/ | |
* Sets transient with db data and 24 hour expiration. | |
* | |
* @return string $data_html HTML table with database data |
<?php | |
/* | |
WordPress settings list (serialized data hidden): | |
/wp-admin/options.php | |
Jetpack settings by modules (defualt hidden): | |
/wp-admin/admin.php?page=jetpack_modules | |
List Reusable Blocks (CPT): |
<?php | |
/* Get unattached files in Media Library */ | |
$args_search = array( | |
'post_type' => 'attachment', | |
'post_status' => 'inherit', | |
'post_parent' => 0, | |
'post_mime_type' => 'application/pdf', // Only PDFs. | |
'posts_per_page' => 40, | |
'orderby' => 'id', | |
'order' => 'ASC', |
Admin or login to a site:
/admin
For some webhosts, inc. Media Temple:
/wp-admin
All Settings list (wp_options database table):
/wp-admin/options.php
Jetpack modules settings (old admin page):
/wp-admin/admin.php?page=jetpack_modules