View functions.php
/* add this to your theme's functions.php file */ | |
/* Add option for URL to column settings */ | |
vc_add_param("vc_column", array( | |
"type" => "vc_link", | |
"class" => "", | |
"heading" => "Column Link", | |
"param_name" => "column_link" | |
)); |
View functions.php
/** | |
* Inject Ads To WordPress Comments - end-callback for wp_list_comments(). | |
* | |
* The Ads HTML is sanitized through wp_kses_post(). | |
* | |
* @version 1.0.11 | |
* @see https://wordpress.stackexchange.com/a/328155/26350 | |
*/ | |
function wpse_comments_ads_injection( $comment, $args, $depth ) { | |
static $instance = 0; |
View so-38602177.php
<?php | |
/** | |
* @version: 1.0.3 | |
* @see http://stackoverflow.com/questions/38551606/do-not-submit-form-after-wrong-code/38602177 | |
*/ | |
add_filter( 'login_form', function() | |
{ | |
$options = get_option( 'authcode_settings' ); |
View ping-screenshot-capture.php
<?php | |
/** | |
* Plugin Name: Ping Screenshots Capture | |
* Description: Ping screenshots capture generation using an hidden iframe only once for published posts | |
* Version: 1.0.0 | |
* Author: birgire | |
*/ | |
namespace PingScreenshotCapture; |
View get_the_category_list.php
/** | |
* Retrieve category list in either HTML list or custom format. | |
* | |
* @since 1.5.1 | |
* | |
* @global WP_Rewrite $wp_rewrite | |
* | |
* @param string $separator Optional, default is empty string. Separator for between the categories. | |
* @param string $parents Optional. How to display the parents. | |
* @param int $post_id Optional. Post ID to retrieve categories. |
View wpse.php
<?php | |
/** | |
* Print the clean basedomain in the admin footer | |
* | |
* Place the file under /wp-content/mu-plugins/wpse.php | |
* | |
* @uses get_clean_basedomain() | |
*/ | |
add_action( 'in_admin_footer', function(){ | |
if( function_exists( 'get_clean_basedomain' ) ) |
View functions.php
/** | |
* Redirect attachment page visits to the parent page, else the home page. | |
*/ | |
add_action( 'template_redirect', function() | |
{ | |
if( ! is_attachment() ) | |
return; | |
if( $parent_id = wp_get_post_parent_id() ) | |
wp_safe_redirect( esc_url( get_permalink( $parent_id ) ) ); |
View wpse-change-image-preview-size.php
<?php | |
/** | |
* Plugin Name: Change the size of the Image preview on the media edit page | |
* Author: Birgir Erlendsson (birgire) | |
* Plugin URI: http://wordpress.stackexchange.com/questions/204280/change-the-size-of-the-image-preview-on-the-media-edit-page | |
* | |
* ------------------------------------------------------------------------------------ | |
* Possible workaround, without core modifications, | |
* but note that the javascript crop-selection numbers will not be accurate, | |
* when $inf <> 400 |
View actions_and_filters.log
Here we list all do_action, do_action_ref_array, apply_filters and apply_filters_ref_array calls (excluding gettext) for the edit.php (post) screen.php: | |
--- | |
muplugins_loaded - do_action | |
pre_site_option_siteurl - apply_filters | |
default_site_option_siteurl - apply_filters | |
pre_option_siteurl - apply_filters | |
option_siteurl - apply_filters | |
site_option_siteurl - apply_filters |
View hueman-theme-sharrre-sharing-bar-on-pages.php
<?php | |
/** | |
* Plugin Name: Hueman Theme - Sharrre Sharing Bar On Pages | |
* Description: Add the Hueman theme's sharing-bar to pages. (Fix for those who don't have a recommended child theme) | |
* Plugin URI: https://gist.github.com/birgire/be3dc8174e227233fa70 | |
* Author: Birgir Erlendsson (birgire) | |
* Author URI: https://github.com/birgire | |
* Version: 0.0.1 | |
* Licence: MIT | |
*/ |
NewerOlder