Skip to content

Instantly share code, notes, and snippets.

root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
@vanbaodo
vanbaodo / gist:44a26f8b1725d534c1ecf767f40b0596
Created January 20, 2017 09:18
Chuyển hướng tới trang khác khi post có shortcode nào đó
<?php
/*
Chuyển hướng tới trang khác khi post có shortcode nào đó
*/
function my_page_template_redirect(){
global $post;
if( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'your_short_code') && ! is_user_logged_in() ) {
wp_redirect(URL_IN_HERE);
exit();
}