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 replace_custom_word( $text ){ | |
| $replace = array( | |
| 'thesis' => '<a style="color:sienna; border-bottom: 1px dotted #ba0000;" href="http://www.site1.com/">Thesis</a>', | |
| 'studiopress' => '<a style="color:sienna; border-bottom: 1px dotted #ba0000;" href="http://www.site2.com/">Studiopress</a>' | |
| ); | |
| $text = str_replace( array_keys( $replace ), $replace, $text ); | |
| return $text; | |
| } |
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 your_shortcode_scripts() | |
| { | |
| global $post; | |
| if( function_exists( 'has_shortcode' ) ) | |
| { | |
| if( has_shortcode( $post->post_content, 'your-shortcode' ) ) | |
| { | |
| wp_enqueue_script( 'whatever' ); | |
| } |
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 | |
| /** | |
| * Flowplayer 5 for WordPress | |
| * | |
| * @package Flowplayer 5 for WordPress | |
| * @author Ulrich Pogson <[email protected]> | |
| * @license GPL-2.0+ | |
| * @link http://flowplayer.org/ | |
| * @copyright 2013 Flowplayer Ltd | |
| */ |
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 | |
| /** | |
| * | |
| * @package Adaptive Shortcode | |
| * @author Ulrich Pogson <[email protected]> | |
| * @license GPL-2.0+ | |
| * @link http://ulrich.pogson.ch | |
| * @copyright 2013 Ulrich Pogson | |
| * | |
| * @wordpress-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
| @media(min-width:979px) { | |
| .navbar-fixed-top,.navbar-fixed-bottom { | |
| position: static; | |
| } | |
| .navbar-fixed-top { | |
| margin-bottom: 20px; | |
| } |
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/sh | |
| for file in `/usr/bin/find . -name '*.po'` ; do /usr/bin/msgfmt -o ${file/.po/.mo} $file ; done |
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
| <script src="//fast.wistia.com/static/embed_shepherd-v1.js"></script> | |
| <script> | |
| wistiaEmbeds.onFind(function(video) { | |
| video.videoFoam(true); | |
| }); | |
| </script> |
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
| <iframe src="http://fast.wistia.net/embed/iframe/3bfl0abrog?videoFoam=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" width="640" height="360"></iframe> | |
| <script src='//fast.wistia.com/static/iframe-api-v1.js'></script> |
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
| <h3>What is internationalization?</h3> | |
| Internationalization is the process of developing your plugin so it can easily be translated into other languages. Internationalization is often abbreviated as <code>i18n</code> (because there are 18 letters between the i and the n). | |
| <h3>Why is internationalization important?</h3> | |
| WordPress is used all over the world, it is a good idea to prepare WordPress plugins so that it can be easily translated into other languages. As a developer, you may not have an easy time providing localizations for all your users however, any translator can successfully localize the plugin without needing to modify the source code itself. | |
| <h3>How to internationalize your plugin?</h3> | |
| In order to make a string translatable in your application you have to wrap the original strings in a call to one of a set of special functions. | |
| <h4>Introduction to Gettext</h4> | |
| WordPress uses the <a href="http://www.gnu.org/software/gettext/">gettext</a> libraries and tools for i18n. Note that if you look online |
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/sh | |
| for file in `/usr/bin/find . -name '*.po'` ; do /usr/bin/msgfmt -o ${file/.po/.mo} $file && /usr/bin/rm $file ; done |