This file contains hidden or 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
services: | |
mysql: | |
image: mysql:8.4.3 | |
restart: always | |
ports: | |
- 3306:3306 | |
volumes: | |
- ./mysql:/var/lib/mysql | |
environment: | |
- MYSQL_ROOT_PASSWORD=root |
This file contains hidden or 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
// Display custom fields in Woocommerce single product page | |
add_action( 'woocommerce_single_product_summary', 'wpsh_single_posts_custom_meta_fields', 10 ); | |
function wpsh_single_posts_custom_meta_fields(){ | |
$post_id = get_the_ID(); | |
$post = get_post( $post_id ); | |
// Replace $some_number and some_number with your own field ID-s | |
// For example: if your field ID is my_field, then replace $some_number with $my_field and some_number with my_field | |
$some_text = get_post_meta( $post->ID, 'some_text' ); // Text field | |
$some_textarea = get_post_meta( $post->ID, 'some_textarea' ); // Textarea field |
This file contains hidden or 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 | |
/** | |
* Get the file type | |
*/ | |
$filetype = $_FILES["attached_assignment_files"]["type"]; | |
$allowed_mime_types = get_allowed_mime_types(); | |
print_r(in_array($filetype, $allowed_mime_types)); | |
foreach ($filetype as $key => $value) { |