A Pen by Naga Vinod Kumar on CodePen.
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('fluentform/file_type_options', function ($types) { | |
$types[] = [ | |
'label' => __('3d files - DWG, STL, STEP, STP, SKP, MAX, FBX, 3DS, IGES, OBJ', 'fluentform'), | |
'value' => 'dwg|stp|stl|STEP|skp|max|fbx|3ds|iges|obj', | |
]; | |
return $types; | |
}); | |
add_filter('upload_mimes', function ($mime_types) { | |
$mime_types ['dwg'] = 'image/vnd.dwg'; |
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="min-h-screen justify-center flex p-16 bg-blue-200"> | |
<div> | |
<!-- This is a revised version. See the original clunky version here: https://codepen.io/KevinBatdorf/pen/ff805cf637420bcbb2caa9d199527247?editors=1010 --> | |
<p class="mb-10 text-center">Drag & drop or press the menu icon button <br>(or use your tab key)</p> | |
<div class="pt-6 pb-4 bg-indigo-500 rounded-lg shadow-xl max-w-sm"> | |
<h1 id="agenda-title" class="text-white font-extrabold text-lg p-6 pt-0">What's the agenda for today?</h1> | |
<ul |
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('fluentform_file_type_options', function ($types) { | |
$types[] = [ | |
'label' => __('3d files - DWG, STL, STEP, STP, SKP, MAX, FBX, 3DS, IGES, OBJ', 'fluentform'), | |
'value' => 'dwg|stp|stl|STEP|skp|max|fbx|3ds|iges|obj', | |
]; | |
return $types; | |
}); | |
add_filter('upload_mimes', function ($mime_types) { | |
$mime_types ['dwg'] = 'image/vnd.dwg'; |
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( 'woocommerce_register_post_type_product', 'wc_modify_product_post_type' ); | |
function wc_modify_product_post_type( $args ) { | |
$args['supports'][] = 'revisions'; | |
return $args; | |
} |
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
# This is a sample build configuration for PHP. | |
# Check our guides at https://confluence.atlassian.com/x/e8YWN for more examples. | |
# Only use spaces to indent your .yml configuration. | |
# ----- | |
# You can specify a custom docker image from Docker Hub as your build environment. | |
image: oneko/php-7.1-node-yarn | |
pipelines: | |
branches: | |
master: |
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 camel_to_snake($input) | |
{ | |
return strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $input)); | |
} | |
function snakeToCamel($input) | |
{ | |
return lcfirst(str_replace(' ', '', ucwords(str_replace('_', ' ', $input)))); | |
} |
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 | |
/** | |
* Grab the url of a publicly embeddable video hosted on vimeo | |
* @param str $video_url The "embed" url of a video | |
* @return str The url of the thumbnail, or false if there's an error | |
*/ | |
function grab_vimeo_thumbnail($vimeo_url){ | |
if( !$vimeo_url ) return false; | |
$data = json_decode( file_get_contents( 'http://vimeo.com/api/oembed.json?url=' . $vimeo_url ) ); |
NewerOlder