Measure time in ONLY HOUR format

Welcome to WPSE. You can try to filter it with: add_filter( ‘human_time_diff’, ‘wpse_hourly_human_time_diff’, 10, 4 ); where the filter’s callback is e.g. /** * Human time difference in hours only. * * @param string $since The difference in human readable text. * @param int $diff The difference in seconds. * @param int $from Unix timestamp … Read more

Adding a custom field to a slug

Try to use function sanitize_title() – documentation, which converts a string into a slug when you check if it is already in the permalink, and when appending it to permalink: function custom_job_post_type_link( $post_id, $post ) { $permalink = $post->post_name; $companyname = $post->_company_name; if ( strpos( $permalink, sanitize_title($companyname) ) ) { // <– Here return; } … Read more

Customizer options limited to specific user roles?

There are 2 ways to do this. When registering a setting you can use the capability: $wp_customize->add_setting( ‘display_excerpt_or_full_post’, array( ‘capability’ => ‘edit_theme_options’, ‘default’ => ‘excerpt’, ‘sanitize_callback’ => function( $value ) { return ‘excerpt’ === $value || ‘full’ === $value ? $value : ‘excerpt’; }, ) ); When registering the control, you can use the render_callback … Read more