<?php
if(isset($_POST['submit'])){
$name = htmlspecialchars(stripslashes(trim($_POST['name'])));
$subject = htmlspecialchars(stripslashes(trim($_POST['subject'])));
$email = htmlspecialchars(stripslashes(trim($_POST['email'])));
$message = htmlspecialchars(stripslashes(trim($_POST['message'])));
if(!preg_match("/^[A-Za-z .'-]+$/", $name)){
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: My Pattern Library | |
* Description: A simple library of block patterns. | |
* Version: 0.1.0 | |
* Requires at least: 5.8 | |
* Requires PHP: 7.0 | |
* Author: Your Name | |
* License: GPL v2 or later | |
* Text Domain: my-pattern-library |
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 strip_word_html($text, $allowed_tags = '<b><i><sup><sub><em><strong><u><br>') | |
{ | |
mb_regex_encoding('UTF-8'); | |
//replace MS special characters first | |
$search = array('/‘/u', '/’/u', '/“/u', '/”/u', '/—/u'); | |
$replace = array('\'', '\'', '"', '"', '-'); | |
$text = preg_replace($search, $replace, $text); | |
//make sure _all_ html entities are converted to the plain ascii equivalents - it appears | |
//in some MS headers, some html entities are encoded and some aren't |
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
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
# | |
WP_OWNER=www-data # <-- wordpress owner | |
WP_GROUP=www-data # <-- wordpress group | |
WP_ROOT=$1 # <-- wordpress root directory |
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
/** | |
* Block Dace update | |
* 8/20/2019, 10:44:12 AM | |
*/ | |
Block::make( __( 'Block Dace List' ) ) | |
->add_tab( __( 'Block Dace List' ), array( | |
Field::make( 'text', 'block_title', __( 'Title' ) )->set_default_value('Open position'), | |
Field::make( 'rich_text', 'block_desc', __( 'Description' ) ), | |
Field::make( 'select', 'block_column', __( 'Column' ) ) | |
->set_options( array( |
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 | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Change size for Yoast SEO OpenGraph image for all content | |
* Credit: Yoast Development team | |
* Last Tested: May 24 2019 using Yoast SEO 11.2.1 on WordPress 5.2.1 | |
*/ | |
add_filter( 'wpseo_opengraph_image_size', 'yoast_seo_opengraph_change_image_size' ); | |
function yoast_seo_opengraph_change_image_size( $string ) { |
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
@mixin element($name) { | |
@at-root #{&}__#{$name}{ | |
@content; | |
} | |
} | |
@mixin modifier($name) { | |
@at-root #{&}--#{$name} { | |
@content; | |
} |
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 | |
/** | |
* Form Class | |
* | |
* Responsible for building forms | |
* | |
* @param array $elements renderable array containing form elements | |
* | |
* @return void |
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 | |
/** | |
* | |
* Simple PHP Pagination | |
* | |
* @author Stichoza | |
* @link http://stichoza.com/ | |
* @email [email protected] | |
* @version 1.0 |
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 | |
/** | |
* Spintax - A helper class to process Spintax strings. | |
* @name Spintax | |
* @author Jason Davis - https://www.codedevelopr.com/ | |
* Tutorial: https://www.codedevelopr.com/articles/php-spintax-class/ | |
*/ | |
class Spintax | |
{ | |
public function process($text) |
NewerOlder