View blockquote-cite-tinymce.js
(function() { | |
tinymce.PluginManager.add('blockquote_cite', function( editor, url ) { | |
editor.addButton( 'blockquote_cite', { | |
title: 'Blockquote & Cite', | |
icon: "icon dashicons-testimonial", | |
onclick: function() { | |
editor.windowManager.open( { | |
title: 'Insert Blockquote and Citation', | |
body: [ | |
{ |
View buddypress-spam-link.php
<?php | |
/* | |
Plugin Name: BuddyPress Spam Link | |
Description: Adds the "Mark as spammer" link back to the admin bar, and adds "Spammer" to the activity stream's entry meta buttons. | |
Plugin URI: http://sillybean.net/ | |
Version: 0.2 | |
Author: Stephanie Leary | |
*/ | |
// restore action moved to settings in 1.6 |
View functions.php
<?php | |
add_filter( 'default_hidden_meta_boxes', 'custom_default_hidden_screen_options', 10, 2 ); | |
function custom_default_hidden_screen_options( $hidden, $screen ) { | |
$hide_these = array( | |
'dashboard_primary', | |
'postcustom', | |
'trackbacksdiv', |
View png_quality_filter.php
<?php | |
// well-known filter to change JPG quality: | |
add_filter( 'jpeg_quality', function( $arg ){ return 100; } ); | |
// lesser-known filter to change quality for any image type: | |
add_filter( 'wp_editor_set_quality', 'any_image_quality', 10, 2 ); | |
add_filter( 'jpeg_quality', 'any_image_quality' ); | |
function any_image_quality( $default_quality, $mime_type = NULL ) { |
View print-acf-field-group.php
<?php | |
$fields = array(); | |
$field_group = get_page_by_title( 'GROUP TITLE HERE', OBJECT, 'acf-field-group' ); | |
if ( is_object( $field_group ) ) { | |
$acf_fields = acf_get_fields_by_id( $field_group->ID ); | |
$fields = wp_list_pluck( $acf_fields, 'label', 'name' ); | |
} | |
foreach ( $fields as $field_name => $field_label ) { |
View userstyles.css
.r-1ovo9ad div { | |
width: 0px !important; | |
} | |
.r-1ovo9ad div div.r-1oszu61 { | |
width: 360px !important; | |
} | |
.r-1ovo9ad form div { | |
width: inherit !important; |
View functions.php
<?php | |
add_action( 'wp', 'my_private_page_404' ); | |
function my_private_page_404() { | |
$queried_object = get_queried_object(); | |
if ( isset( $queried_object->post_status ) && 'private' == $queried_object->post_status && !is_user_logged_in() ) { | |
wp_safe_redirect( add_query_arg( 'private', '1', wp_login_url( $_SERVER['REQUEST_URI'] ) ) ); | |
exit; | |
} |
View tinymce-widget-styleselect.txt
<?php | |
// PHP goes in functions.php or similar | |
// Callback function to filter the MCE settings | |
function my_mce_style_options( $init_array ) { | |
// Define the style_formats array | |
$style_formats = my_mce_styleselect_options(); | |
// Insert the array, JSON ENCODED, into 'style_formats' | |
$init_array['style_formats'] = json_encode( $style_formats ); |
View 404.php
<?php get_header(); ?> | |
<div id="content" class="section"> | |
<h2>I'm sorry. I couldn't find the page you requested.</h2> | |
<p>You can try searching for it or looking for it in the <a href="/sitemap">site map</a>.</p> | |
<?php get_template_part( 'searchform' ); ?> | |
<?php |
View functions.php
<?php | |
add_filter( 'genesis_noposts_text', 'my_custom_404_message', 10, 2 ); | |
function my_custom_404_message( $text ) { | |
$queried_object = get_queried_object(); | |
if ( isset( $queried_object->post_status ) && 'private' == $queried_object->post_status && !is_user_logged_in() ) | |
$text = sprintf( __( 'This page is restricted. Please <a href="%s">log in or register</a>.' ), wp_login_url( $_SERVER['REQUEST_URI'] ) ); | |
elseif ( is_search() ) |
NewerOlder