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
div { | |
color: red; | |
} |
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
#!/bin/bash | |
cd $(git rev-parse --show-toplevel) | |
# JSHINT | |
echo -n "Jshint..." | |
JSHINTRESULT=`jshint .` | |
JSHINT=$? | |
if [ $JSHINT != 0 ] | |
then |
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 | |
public function add_endpoints( ) | |
{ | |
add_rewrite_endpoint( 'galleri', EP_PERMALINK ); | |
} | |
add_action( 'init', 'add_endpoints'); |
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 | |
$fields = array( | |
'countries' => array( | |
'type' => 'select', | |
'groups' => array( | |
array( | |
'name' => 'Europe' | |
'options' => array( | |
'no' => 'Norge', | |
'sv' => 'Sverige' |
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 | |
// Hämta en placeholder-bild | |
$image_url = 'http://placehold.it/640x480'; | |
// Spara bilden till inlägget med ID 1 | |
$image_html = media_sideload_image( $image_url, 1, 'En placeholder-bild' ); | |
// Klart! | |
?> |
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 | |
// Anta att vi har bildens binära data i $binary_image. | |
// ID på inlägg filen ska höra till | |
$post_id = 1; | |
// Filändelse/typ | |
$file_type = 'image/jpeg'; | |
// Filnamn |
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_action( | |
'plugins_loaded', | |
array( My_Plugin::get_instance(), 'setup' ) | |
); | |
class My_Plugin | |
{ | |
/** |
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
<IfModule mod_rewrite.c> | |
RewriteRule ^readme.html - [F] | |
RewriteRule ^licens(.*).txt - [F] | |
</IfModule> |
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 | |
if( !is_admin() ) | |
{ | |
remove_action( 'wp_head', 'wp_generator' ); | |
} |
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( 'ENVIRONMENT', getenv( 'ENVIRONMENT' ) ? getenv( 'ENVIRONMENT' ) : 'production' ); | |
define( 'DOMAIN', $_SERVER['HTTP_HOST'] ); | |
// Här är default-inställningarna. De kan overridas för varje stage | |
$settings = array( | |
// Sökvägar | |
'WP_SITEURL' => 'http://' . DOMAIN . '/wordpress', | |
'WP_HOME' => 'http://' . DOMAIN, | |
'WP_CONTENT_DIR' => dirname( __FILE__ ) . '/content', |
OlderNewer