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
function dsourc_hide_notices(){ | |
$user = wp_get_current_user(); | |
if (!($user->roles[0] == 'administrator')) { | |
remove_all_actions( 'admin_notices' ); | |
} | |
} | |
add_action( 'admin_head', 'dsourc_hide_notices', 1 ); |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<!-- Required meta tags --> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<!-- Bootstrap CSS --> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> |
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
array( | |
'id' => $prefix . 'address', | |
'type' => 'text', | |
'name' => esc_html__( 'Address', 'star' ), | |
), | |
array( | |
'id' => $prefix . 'location', | |
'type' => 'map', | |
'name' => esc_html__( 'Location', 'star' ), | |
'address_field' => $prefix . 'address', |
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
array( | |
'id' => $prefix . 'location', | |
'type' => 'group', | |
'name' => esc_html__( 'Location', 'star' ), | |
'fields' => array( | |
array( | |
'id' => $prefix . 'address', | |
'type' => 'text', | |
'name' => esc_html__( 'Address', 'star' ), | |
), |
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 to get the sub-field values from groupped meta fields. | |
function sk_meta($group, $field){ | |
$group = rwmb_meta($group); | |
$value = isset($group[$field]) ? $group[$field] : '' ; | |
return $value; | |
} |