This file contains hidden or 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: Anarchy | |
* Description: Enable anarchy in WordPress - allow every user to do EVERYTHING in WP Admin. | |
* Version: 1.0.0 | |
* Author: Arūnas Liuiza | |
* Author URI: https://arunas.co | |
* License: GPL2 | |
* License URI: https://www.gnu.org/licenses/gpl-2.0.html | |
* |
This file contains hidden or 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_filter( 'menu_title', 'arunasco_icons' ); | |
function arunasco_title( $title ) { | |
$title = do_shortcode( $title ); | |
return $title; | |
} | |
// [icon name="fa-coffee"] | |
add_shortcode( 'icon', 'arunasco_icons_shortcode' ); | |
function arunasco_icons_shortcode( $attr=array(), $content = '' ) { |
This file contains hidden or 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 themename_customize_register($wp_customize){ | |
$wp_customize->add_section('themename_color_scheme', array( | |
'title' => __('Color Scheme', 'themename'), | |
'priority' => 120, | |
)); | |
// ============================= |
This file contains hidden or 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 | |
$args = array( | |
'post_type' => 'post', | |
'tax_query' => array(), | |
); | |
if ( $filtercategory ) { | |
$args['tax_query'][] = array( | |
'taxonomy' => 'category', | |
'terms' => $filtercategory, | |
'field' => 'term_id', |
This file contains hidden or 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: Apex Add Latin-extended | |
Plugin URI: http://arunas.co | |
Description: Add Latin-ext to Google fonts in Apex theme | |
Author: Arūnas Liuiza | |
Version: 0.1.0 | |
Author URI: http://arunas.co | |
*/ |
This file contains hidden or 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_filter( 'harvestteachings_metabox_fields', 'arunas_teaching_author' ); | |
function arunas_teaching_author($metabox) { | |
$metabox['fields']['ht_speaker']['default'] = 'Your Speaker name'; | |
return $metabox; | |
} |
This file contains hidden or 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 | |
define('TOKEN_SECRET', 'plugin_token' ); | |
define('PLUGIN_SLUG', 'plugin_slug' ); | |
EdwinDeployer::parse(); | |
class EdwinDeployer { | |
public static $json = false; | |
public static $repo = ''; |
This file contains hidden or 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 cart_notice() { | |
if ( arunas_only_virtual_products() ) { | |
return true; | |
} | |
$free_shipping_settings = get_option( 'woocommerce_free_shipping_settings' ); | |
$maximum = $free_shipping_settings['min_amount']; | |
$current = WC()->cart->subtotal; | |
$formatteddifference = wc_price( $maximum - $current ); |
This file contains hidden or 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 get_thumbnail_url( $size='thumbnail' ) { | |
$image_id = get_post_thumbnail_id( get_the_ID() ); | |
$thumb = wp_get_attachment_image_src( $image_id, 'thumbnail_size' ); | |
$url = $thumb['0']; | |
return $url; | |
} |
This file contains hidden or 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_filter( 'pre_update_option_blogname', 'arunas_limit_blogname', 10, 2 ); | |
function arunas_limit_blogname( $value, $old_value ) { | |
// check for length (pr do any other kind of validation) | |
if ( 40 < strlen($value) ) { | |
// throw error via Settings API | |
add_settings_error( | |
'blogname', // option name | |
'blogname', // error id | |
__( 'Blog title is too long', 'plugin-slug' ), |