ID, $field['id'], true ); $thepostid = empty( $thepostid ) ? $post->ID : $thepostid; $field['class'] = isset( $field['class'] ) ? $field['class'] : 'urfl-checkbox'; $field['style'] = isset( $field['style'] ) ? $field['style'] : ''; $field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : ''; $field['value'] = isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true ); $field['name'] = isset( $field['name'] ) ? $field['name'] : $field['id']; $field['desc'] = isset( $field['desc'] ) ? $field['desc'] : ''; echo '
'; } /** * Renders the Select field in metabox. * * @param array $field Metabox Field. */ public function ur_metabox_select( $field ) { global $thepostid, $post; $thepostid = empty( $thepostid ) ? $post->ID : $thepostid; $field['class'] = isset( $field['class'] ) ? $field['class'] : 'select'; $field['style'] = isset( $field['style'] ) ? $field['style'] : ''; $field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : ''; $field['value'] = isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true ); $field['name'] = isset( $field['name'] ) ? $field['name'] : $field['id']; $field['desc'] = isset( $field['desc'] ) ? $field['desc'] : ''; $get_meta_data = get_post_meta( $post->ID, $field['id'], true ); echo ''; } /** * Renders the Multiple Select field in metabox. * * @param array $field Metabox Field. */ public function ur_metabox_multiple_select( $field ) { global $thepostid, $post; $thepostid = empty( $thepostid ) ? $post->ID : $thepostid; $field['class'] = isset( $field['class'] ) ? $field['class'] : 'multiple-select'; $field['style'] = isset( $field['style'] ) ? $field['style'] : ''; $field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : ''; $field['value'] = isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true ); $field['name'] = isset( $field['name'] ) ? $field['name'] : $field['id']; $field['desc'] = isset( $field['desc'] ) ? $field['desc'] : ''; $get_meta_data = get_post_meta( $post->ID, chop( $field['id'], '[]' ), true ); echo ''; } /** * Renders the Input field in metabox. * * @param array $field Metabox Field. */ public function ur_metabox_input( $field ) { global $thepostid, $post; $get_meta_data = get_post_meta( $post->ID, $field['id'], true ); $thepostid = empty( $thepostid ) ? $post->ID : $thepostid; $field['class'] = isset( $field['class'] ) ? $field['class'] : 'urfl-input'; $field['style'] = isset( $field['style'] ) ? $field['style'] : ''; $field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : ''; $field['value'] = ( isset( $get_meta_data ) && '' !== $get_meta_data ) ? $get_meta_data : $field['value']; $field['name'] = isset( $field['name'] ) ? $field['name'] : $field['id']; $field['desc'] = isset( $field['desc'] ) ? $field['desc'] : ''; echo ''; } /** * Renders the Toggle field in metabox. * * @param array $field Metabox Field. */ public function ur_metabox_toggle( $field ) { global $thepostid, $post; $get_meta_data = get_post_meta( $post->ID, $field['id'], true ); $thepostid = empty( $thepostid ) ? $post->ID : $thepostid; $field['class'] = isset( $field['class'] ) ? $field['class'] : 'urfl-toggle'; $field['style'] = isset( $field['style'] ) ? $field['style'] : ''; $field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : ''; $field['value'] = isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true ); $field['name'] = isset( $field['name'] ) ? $field['name'] : $field['id']; $field['desc'] = isset( $field['desc'] ) ? $field['desc'] : ''; echo ''; } }