get_user_meta
current_user_can
update_user_meta
bundle.js?ver=1.11:1Not allowed to load local resource: file:///C:/Users/.../facility.bundle.js
componentDidMount(){
var Facility;
require.ensure([], function(require) {
Facility = require('./Facility').default;
render(<Facility/>, document.getElementById('fl'));
}, 'facility');
}
render() {
return (
<div>
<div id="fl"></div>
<?php }
add_action( 'show_user_profile', 'show_profile_fields' );
add_action( 'edit_user_profile', 'show_profile_fields' );
//Save User Team option
function save_profile_fields( $user_id ) {
if (!current_user_can('edit_user', $user_id ))
return false;
update_user_meta( $user_id, 'squad', $_POST['squad'] );
update_user_meta( $user_id, 'facility', $_POST['facility'] );
}
add_action( 'personal_options_update', 'save_profile_fields' );
add_action( 'edit_user_profile_update', 'save_profile_fields' );
/* Change Excerpt length */
function custom_excerpt_length( $length ) {
return 30;
}
add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 );
wp_trim_words( get_the_content(), $num_words = 20, $more = null )