Пример #1
0
 public function test_served_from_local_machine()
 {
     $this->assertTrue(served_from_local_machine('127.0.0.1', '127.0.0.1', 'When passed identical arguments, true is returned'));
     $this->assertFalse(served_from_local_machine('127.0.0.1', '127.0.0.2', 'When passed non-identical arguments, false is returned'));
 }
Пример #2
0
// Theme Support
add_theme_support('post-thumbnails');
// Included classes
include 'src/CreateMetaBox.php';
// Includes
include 'inc/functions/tna-globals.php';
include 'inc/functions/dimox_breadcrumbs.php';
include 'inc/functions/custom-fields.php';
include 'inc/functions/url-rewriting.php';
include 'inc/functions/images.php';
include 'inc/functions/404-redirect.php';
include 'inc/functions/image_caption.php';
include 'inc/functions/tiny_mce.php';
include 'inc/functions/notification-banner.php';
// Set path to mega menu HTML
set_path_to_mega_menu(served_from_local_machine($_SERVER['SERVER_ADDR'], $_SERVER['REMOTE_ADDR']));
// Gets the first sentence from the content area of a page
if (!function_exists('first_sentence')) {
    function first_sentence($content)
    {
        $content = strip_tags($content);
        $pos = strpos($content, ".");
        return substr($content, 0, $pos + 1);
    }
}
// Enables the Excerpt meta box in Page edit screen
function wpcodex_add_excerpt_support_for_pages()
{
    add_post_type_support('page', 'excerpt');
}
add_action('init', 'wpcodex_add_excerpt_support_for_pages');