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 | |
/* get featured image url function */ | |
function mdw_featured_img_url( $mdw_featured_img_size ) { | |
$mdw_image_id = get_post_thumbnail_id(); | |
$mdw_image_url = wp_get_attachment_image_src( $mdw_image_id, $mdw_featured_img_size ); | |
$mdw_image_url = $mdw_image_url[0]; | |
return $mdw_image_url; | |
} | |
?> |
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 | |
/* protects site from those who are not assigned to it */ | |
function mdw_user_has_blog_role() { | |
/* get the global blog id */ | |
global $blog_id; | |
/* check user is part of this blog, and die if they are not */ | |
if( ! is_blog_user( $blog_id ) ) | |
wp_die( __("You are trying to access a site that you are not allowed to see. Naughty you!") ); |
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 | |
function wpct_create_db_table() { | |
global $wpdb; | |
/* create the table name using the wordpress table prefix for this site */ | |
$wpct_tablename = $wpdb->prefix . "wpct"; | |
/* setup the structure of the table creating these as a variable */ |
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 | |
/* create a function to get the values from this page load */ | |
function wpct_track_content() { | |
/* call the global post variable to gain access to post data */ | |
global $post; | |
/* setup an array to store all our values */ | |
$wpct_post_values = array(); |
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 | |
/** | |
Plugin Name: User Switching in Admin Bar | |
Plugin URI: http://markwilkinson.me | |
Description: Build upon the User Switching plugin (http://wordpress.org/extend/plugins/user-switching/) by John Blackbourn and adds a dropdown list of users in the WordPress admin bar with a link to switch to that user. | |
Author: Mark Wilkinson | |
Author URI: http://markwilkinson.me | |
Version: 1.0 | |
*/ |
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 | |
/* add our function to the admin meny action */ | |
add_action( 'admin_menu', 'pxjn_remove_menus', 999 ); | |
function pxjn_remove_menus() { | |
/* get the current user id */ | |
$pxjn_current_user_id = $current_user->ID; // get the 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 | |
// ** MySQL settings - You can get this info from your web host ** // | |
/** The name of the database for WordPress */ | |
define('DB_NAME', 'db_name'); | |
/** MySQL database username */ | |
define('DB_USER', 'db_user'); | |
/** MySQL database password */ | |
define('DB_PASSWORD', 'db_password'); |
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 | |
/* | |
Plugin Name: Multisite Site Creation Activation Plugin | |
Plugin URI: | |
Description: Plugin which runs a function to activate other plugins when new sites are created. | |
Version: 1.0 | |
Author: Mark Wilkinson | |
Author URI: http://markwilkinson.me | |
License: GPLv2 or later | |
*/ |
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 | |
/*************************************************************** | |
* Function pxlcore_whistles_post_labels() | |
* Changes the post labels for the Whistles post type. | |
***************************************************************/ | |
function pxlcore_whistles_post_labels( $labels ) { | |
$labels->name = 'Snippets'; | |
$labels->singular_name = 'Snippet'; | |
$labels->menu_name = 'Snippets'; |
OlderNewer