One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| <?php | |
| if (isset($_POST['video_req']) && ! empty($_POST['video_req'])){ | |
| if ( preg_match("+youtube.com+", $_POST['video_req']) ) { | |
| $video = htmlspecialchars($_POST['video_req']); | |
| $strpos_yt = strpos($video, "youtube.com"); | |
| $beginning = substr($video, 0, $strpos_yt) ; | |
| if ($beginning != "http://www." ) | |
| {$video = substr_replace ($video, "http://www.", 0, $strpos_yt ) ;} |
| <?php | |
| /** | |
| * Plugin name: Different theme for guest than logged in user | |
| */ | |
| // You can also put this file in mu-plugins dir. | |
| add_filter( 'template', 'switch_theme__db' ); | |
| add_filter( 'stylesheet', 'switch_theme__db' ); |
| <?php | |
| class BackupDroplet | |
| { | |
| private $apiUrl = 'https://api.digitalocean.com/v2/'; | |
| private $token; | |
| private $dropletId; | |
| public function __construct($token, $dropletId) | |
| { |
| <?php | |
| /* | |
| * simple HttpRequest example using PHP | |
| * tom slankard | |
| */ | |
| class HttpRequest { | |
| public $url = null; |
| <?php | |
| /** | |
| * Convert a comma separated file into an associated array. | |
| * The first row should contain the array keys. | |
| * | |
| * Example: | |
| * | |
| * @param string $filename Path to the CSV file | |
| * @param string $delimiter The separator used in the file | |
| * @param boolean $asHash Use header row as keys in the returned array |
| function my_tracking_code() { | |
| echo 'Paste tracking code from Google Analytics here'; | |
| } | |
| add_action( 'wp_footer', 'my_tracking_code' ); |
You know how, in JavaScript, we can set a value to a variable if one doesn't, like this:
name = name || 'joe';This is quite common and very helpful. Another option is to do:
name || (name = 'joe');