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 will browse a Slack export folder and download all files in a new /export folder | |
# | |
# HOW TO: | |
# 1. As a Workspace admin, download an export of your Slack history (https://www.slack.com/services/export) | |
# 2. Make sure you have jq installed (https://stedolan.github.io/jq/) | |
# 3. Place this file at the root of your Slack export folder, next to channels.json | |
# 4. Run `bash slack-files-downloader.sh` in your terminal | |
# |
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('wp_unique_post_slug', 'seed_unique_slug', 10, 4); | |
function seed_unique_slug($slug, $post_id, $post_status, $post_type) | |
{ | |
if (in_array($post_type, ['post', 'product'])) { | |
$post = get_post($post_id); | |
if (empty($post->post_name) || $slug != $post->post_name) { | |
$slug = randomSlug(); | |
} | |
} | |
return $slug; |
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
on: [push] | |
jobs: | |
deploy_job: | |
runs-on: ubuntu-latest | |
name: deploy | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install Dependencies |
This file has been truncated, but you can view the full file.
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
[ | |
{ | |
"zipCode": "10100", | |
"subDistrictList": [ | |
{ | |
"subDistrictId": "100801", | |
"districtId": "1008", | |
"provinceId": "10", | |
"subDistrictName": "ป้อมปราบ" |
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 | |
// Running No. Slug | |
add_action('wp_insert_post', 'change_slug'); | |
function change_slug($post_id, $force = false) | |
{ | |
$post_types = ['news', 'faq']; | |
$post_type = $_POST['post_type']; | |
if (!in_array($post_type, $post_types) || get_field('no', $post_id)) { | |
return; |
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
._th:not(:lang(th)), | |
._en:not(:lang(en-US)) { | |
display: none !important; | |
} |
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
// GENERATEBLOCKS CSS | |
if (function_exists('generateblocks_get_frontend_block_css')) { | |
add_filter('the_content', 'p_css'); | |
} | |
function p_css($content) { | |
global $post; | |
$css = wp_strip_all_tags(generateblocks_get_frontend_block_css()); | |
return '<style id="gb-css">' . $css . '</style>' . $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 | |
// Custom Field: demo_field | |
// Shortcode: [show_field] | |
function show_custom_field() { | |
$meta = get_post_meta( get_the_ID(), 'demo_field', true ); | |
return '<em>' . $meta . '</em>'; | |
} | |
add_shortcode('show_field', 'show_custom_field'); |
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_filter('sstp_views', 'sstp_change_views',10, 2 ); | |
function sstp_change_views($num, $postID) { | |
if ($postID == 123) { | |
return $num + 500; | |
} | |
return $num; | |
} |
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
<div class="most-popular"> | |
<?php | |
$args = array( | |
'posts_per_page' => 5, | |
'orderby' => 'meta_value_num', | |
'order' => 'DESC', | |
'meta_key' => 's_stat', | |
'date_query' => array( | |
'after' => '30 days ago' | |
) |
NewerOlder