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 my_add_action_links( $links ) { | |
$links[] = '<a href="'. get_admin_url(null, 'options-general.php?page=plugin_name') .'">Settings</a>'; | |
return $links; | |
} | |
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'my_add_action_links' ); |
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: Ejemplos WPValencia meetup | |
* Plugin URI: http://wordpress.org/plugins | |
* Description: Ejemplos para presentacion Introducción a los hooks. | |
* Version: 0.0.1 | |
* Author: Lucy Tomas | |
* Author URI: http://lucytomas.com | |
* License: GPLv2+ | |
*/ |
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
##### Theme #### | |
Cobalt2 | |
https://packagecontrol.io/packages/Theme%20-%20Cobalt2 | |
##### Packages ##### | |
Package Controll: | |
https://packagecontrol.io/installation | |
Sublime Code Sniffer - phpcs and phpmd |
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
/** | |
* Disables the Insert Media button while the required fields are empty. | |
*/ | |
(function(){ | |
var SelectionEventBus = _.extend({ | |
currentSelection: {}, | |
invalidSelection: {}, | |
}, Backbone.Events); | |
var updateInvalid = function( collection ) { |
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 gcd( $a, $b ){ | |
return ($a % $b) ? gcd($b,$a % $b) : $b; | |
} | |
function ratio( $x, $y ){ | |
$gcd = gcd($x, $y); | |
return ($x/$gcd).':'.($y/$gcd); | |
} | |
/** |
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
var originalWidth = 2205; | |
var originalHeight = 3500; | |
var maxSize = 160; | |
/** Thumbnails max width and height. */ | |
var ratio = Math.min( maxSize / originalWidth, maxSize / originalHeight ); | |
var thumbWidth = originalWidth * ratio; | |
var thumbHeight = originalHeight * ratio; |
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
# From https://kellenmace.com/set-up-ssl-locally-on-vvv-vagrant-wordpress-site/ | |
cd ~/vagrant-local/config/nginx-config/sites | |
mkdir ssl | |
cd ssl | |
# Generate ssl key and certificate | |
openssl genrsa -out example.dev.key 2048 | |
openssl req -new -x509 -key example.dev.key -out example.dev.cert -days 3650 -subj /CN=example.dev |
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 | |
/** | |
* Return true if current screen is edit screen of a post type or list of post types. | |
* | |
* @param string|array $post_type Single or list of post types. | |
* @return boolean | |
*/ | |
function is_edit_screen( $post_types = array() ) { | |
global $pagenow; | |
if ( 'post.php' !== $pagenow ) { |
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 | |
/** | |
* Encrypt password using OpenSSL | |
* | |
* @param string $password The password to encrypt. | |
*/ | |
public function encrypt_password( $password ) { | |
$encryption_key = base64_decode( SECURE_AUTH_KEY ); | |
$iv = openssl_random_pseudo_bytes( openssl_cipher_iv_length( 'aes-256-cbc' ) ); | |
$encrypted = openssl_encrypt( $password, 'aes-256-cbc', $encryption_key, OPENSSL_RAW_DATA, $iv ); |
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
Using vvv2 with vv create from https://github.com/bradp/vv has incomaptibility | |
Workarund: | |
First add site to vvv-custom.yml | |
testvv: | |
skip_provisioning: false | |
hosts: | |
- testvv.dev |
OlderNewer