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
*.log | |
.htaccess | |
sitemap.xml | |
sitemap.xml.gz | |
wp-config.php | |
wp-content/advanced-cache.php | |
wp-content/backup-db/ | |
wp-content/backups/ | |
wp-content/blogs.dir/ | |
wp-content/cache/ |
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 advanced_asyc_scripts($url) { | |
if ( strpos( $url, '#asyncload') === false ) { | |
return $url; | |
} else if ( is_admin() ) { | |
return str_replace( '#asyncload', '', $url ); | |
} else { | |
return str_replace( '#asyncload', '', $url )."' async='async' defer='defer"; | |
} | |
} |
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 | |
$mobile = false; | |
$useragent=$_SERVER['HTTP_USER_AGENT']; | |
if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipa |
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 | |
/** | |
* Abstract class which has helper functions to get data from the database | |
*/ | |
abstract class Base_Custom_Data | |
{ | |
/** | |
* The current table name | |
* | |
* @var boolean |
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: Custom table example | |
Description: example plugin to demonstrate wordpress capatabilities | |
Plugin URI: http://mac-blog.org.ua/ | |
Author URI: http://mac-blog.org.ua/ | |
Author: Marchenko Alexandr | |
License: Public Domain | |
Version: 1.1 | |
*/ |
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 | |
add_shortcode( 'front_end_post_form', 'front_end_post_form' ); | |
function front_end_post_form( $atts ) { | |
ob_start();?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
$('#succes').hide(); | |
}); |
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 | |
$upload_dir = wp_upload_dir(); | |
$image_data = file_get_contents($image_url); | |
$filename = basename($image_url); | |
if(wp_mkdir_p($upload_dir['path'])) $file = $upload_dir['path'] . '/' . $filename; | |
else $file = $upload_dir['basedir'] . '/' . $filename; | |
file_put_contents($file, $image_data); | |
$wp_filetype = wp_check_filetype($filename, null ); | |
$attachment = array( | |
'post_mime_type' => $wp_filetype['type'], |
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
$wp_customize->add_setting( 'themeslug_dropdownpages_setting_id', array( | |
'capability' => 'edit_theme_options', | |
'sanitize_callback' => 'themeslug_sanitize_dropdown_pages', | |
) ); | |
$wp_customize->add_control( 'themeslug_dropdownpages_setting_id', array( | |
'type' => 'dropdown-pages', | |
'section' => 'custom_section', // Add a default or your own section | |
'label' => __( 'Custom Dropdown Pages' ), | |
'description' => __( 'This is a custom dropdown pages option.' ), |
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
add_filter( 'rest_prepare_(post_type)', 'function_name', 10, 3 ); | |
function function_name( $data, $post, $request ) { | |
$_data = $data->data; | |
$thumbnail_id = get_post_thumbnail_id( $post->ID ); | |
$thumbnail_full = wp_get_attachment_image_src( $thumbnail_id, 'full' ); | |
$thumbnail_thumb = wp_get_attachment_image_src( $thumbnail_id, 'thumbnail' ); | |
$thumbnail_medium = wp_get_attachment_image_src( $thumbnail_id, 'medium' ); | |
$thumbnail_large = wp_get_attachment_image_src( $thumbnail_id, 'large' ); | |
if( ! empty($thumbnail_id) ) { |
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 | |
/* | |
* Paginate Advanced Custom Field repeater | |
*/ | |
if( get_query_var('page') ) { | |
$page = get_query_var( 'page' ); | |
} else { | |
$page = 1; | |
} | |
// Variables |
OlderNewer