It's that simple:
$os = getOS($_SERVER['HTTP_USER_AGENT']);
echo $os;| /** | |
| * Changes the class on the custom logo in the header.php | |
| */ | |
| function helpwp_custom_logo_output( $html ) { | |
| $html = str_replace('custom-logo-link', 'navbar-brand', $html ); | |
| return $html; | |
| } | |
| add_filter('get_custom_logo', 'helpwp_custom_logo_output', 10); |
| <?php if ( get_field( 'field_name' ) ): ?> | |
| This is displayed when the field_name is TRUE or has a value. | |
| <?php else: // field_name returned false ?> | |
| This is displayed when the field is FALSE, NULL or the field does not exist. | |
| <?php endif; // end of if field_name logic ?> |
| <?php | |
| $type = 'custom_post_type'; | |
| $args = array( | |
| 'post_type' => $type, | |
| 'post_status' => 'publish', | |
| 'posts_per_page' => -1, | |
| 'ignore_sticky_posts'=> true | |
| ); | |
| $my_query = null; | |
| $my_query = new WP_Query($args); |
| function slug($str){ | |
| $str = strtolower(trim($str)); | |
| $str = preg_replace('/[^a-z0-9-]/', '-', $str); | |
| $str = preg_replace('/-+/', "-", $str); | |
| return $str; | |
| } |
| //http://epsiloncool.ru/programmirovanie/preventing-multiple-submits-in-contact-form-7 | |
| jQuery(document).on('click', '.wpcf7-submit', function(e){ | |
| if( jQuery('.ajax-loader').hasClass('is-active') ) { | |
| e.preventDefault(); | |
| return false; | |
| } | |
| }); |
| <?php | |
| // Use an ACF image field | |
| // Set the 'return value' option to "array" (this is the default) | |
| // This example uses three image sizes, called medium, medium_large, thumbnail | |
| $imageobject = get_field('image'); | |
| if( !empty($imageobject) ): | |
| echo '<img alt="' . $imageobject['title'] . '" src="' . $imageobject['sizes']['medium'] . '" srcset="' . $imageobject['sizes']['medium_large'] .' '. $imageobject['sizes']['medium_large-width'] .'w, '. $imageobject['sizes']['medium'] .' '. $imageobject['sizes']['medium-width'] .'w, '. $imageobject['sizes']['thumbnail'] .' '. $imageobject['sizes']['thumbnail-width'] .'w">'; | |
| endif; | |
| ?> |
| /** | |
| * Hide Course complete button until complete all lessons in Tutor LMS | |
| * | |
| */ | |
| add_filter('tutor_course/single/complete_form', 'tutor_lms_hide_course_complete_btn'); | |
| function tutor_lms_hide_course_complete_btn($html){ | |
| $completed_lesson = tutils()->get_completed_lesson_count_by_course(); | |
| $lesson_count = tutils()->get_lesson_count_by_course(); |
| <?php | |
| /* | |
| * ================================================================================================= | |
| * Below both hooks works for custom post types. | |
| * e.g. Suppose we have custom post-type name : Books | |
| * @ref https://codex.wordpress.org/Plugin_API/Action_Reference/manage_$post_type_posts_custom_column | |
| * ================================================================================================= | |
| */ |