Skip to content

Commit

Permalink
Merge pull request #10 from uriweb/release-1.0.4
Browse files Browse the repository at this point in the history
Release 1.0.4
  • Loading branch information
alexandragauss authored Apr 3, 2024
2 parents 067b8da + ece716e commit 0763c92
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 104 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Contributors: Brandon Fuller, Alexandra Gauss, Sarah Pucino
Tags: plugins
Requires at least: 4.0
Tested up to: 5.7
Stable tag: 1.0.3
Stable tag: 1.0.4
159 changes: 83 additions & 76 deletions inc/uri-careers-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,67 +16,55 @@
function uri_careers_create_program_post_type() {

register_post_type(
'majors',
array(
'labels' => array(
'name' => 'Majors',
'singular_name' => 'Major',
'menu_name' => 'Majors',
'all_items' => 'All Majors',
'edit_item' => 'Edit Major',
'view_item' => 'View Major',
'view_items' => 'View Majors',
'add_new_item' => 'Add New Major',
'new_item' => 'New Major',
'parent_item_colon' => 'Parent Major:',
'search_items' => 'Search Majors',
'not_found' => 'No majors found',
'not_found_in_trash' => 'No majors found in Trash',
'archives' => 'Major Archives',
'attributes' => 'Major Attributes',
'insert_into_item' => 'Insert into major',
'uploaded_to_this_item' => 'Uploaded to this major',
'filter_items_list' => 'Filter majors list',
'filter_by_date' => 'Filter majors by date',
'items_list_navigation' => 'Majors list navigation',
'items_list' => 'Majors list',
'item_published' => 'Major published.',
'item_published_privately' => 'Major published privately.',
'item_reverted_to_draft' => 'Major reverted to draft.',
'item_scheduled' => 'Major scheduled.',
'item_updated' => 'Major updated.',
'item_link' => 'Major Link',
'item_link_description' => 'A link to a major.',
),
'public' => true,
'exclude_from_search' => false,
'show_in_rest' => true,
'menu_icon' => 'dashicons-businesswoman',
'supports' => array(
0 => 'title',
1 => 'editor',
2 => 'thumbnail',
),
'delete_with_user' => false,
)
'career-data',
array(
'label' => 'Careers by Major',
'description' => 'Career data by major',
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'capability_type' => 'post',
'hierarchical' => true,
'rewrite' => array( 'slug' => 'careers-by-major' ),
'exclude_from_search' => false,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions', 'author' ),
'show_in_rest' => true,
'has_archive' => true,
'labels' => array(
'name' => 'Career Data',
'singular_name' => 'Career Data',
'menu_name' => 'Career Data',
'all_items' => 'All Career Data',
'edit_item' => 'Edit Career Data',
'view_item' => 'View Career Data',
'view_items' => 'View All Career Data',
'add_new_item' => 'Add New Career Data',
'new_item' => 'New Career Data',
'parent_item_colon' => 'Parent Career Data:',
'search_items' => 'Search All Career Data',
'not_found' => 'No career data found',
'not_found_in_trash' => 'No career data found in Trash',
'archives' => 'Career Data Archives',
'attributes' => 'Career Data Attributes',
'insert_into_item' => 'Insert into Career Data',
'uploaded_to_this_item' => 'Uploaded to this career data',
'filter_items_list' => 'Filter career data list',
'filter_by_date' => 'Filter career data by date',
'items_list_navigation' => 'Career Data list navigation',
'items_list' => 'Career Data list',
'item_published' => 'Career Data published.',
'item_published_privately' => 'Career Data published privately.',
'item_reverted_to_draft' => 'Career Data reverted to draft.',
'item_scheduled' => 'Career Data scheduled.',
'item_updated' => 'Career Data updated.',
'item_link' => 'Career Data Link',
'item_link_description' => 'A link to career data.',
),
'menu_icon' => 'dashicons-businesswoman',
'delete_with_user' => false,
)
);

register_taxonomy(
'careersfrommajors',
array(
0 => 'careers',
),
array(
'hierarchical' => true,
'label' => 'Major to Career',
'show_admin_column' => true,
'show_ui' => true,
'show_in_rest' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'careers' ),
'singular_label' => 'Career',
)
);
}
add_action( 'init', 'uri_careers_create_program_post_type' );

Expand All @@ -89,15 +77,31 @@ function uri_careers_create_program_post_type() {
register_field_group(
array(
'key' => 'group_64dcf3d914d5d',
'title' => 'Major Fields',
'title' => 'Career Data Fields',
'fields' => array(
array(
'key' => 'field_64dcf64afd993',
'label' => 'Majors Link',
'name' => 'majors_link',
'label' => 'Academic Program Website',
'name' => 'program_link',
'aria-label' => '',
'type' => 'text',
'instructions' => 'Link to Majors page',
'instructions' => 'Link to the academic program on the department website',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
),
array(
'key' => 'field_65fdd962ed577',
'label' => 'Advising Major Page',
'name' => 'advising_major',
'type' => 'text',
'instructions' => 'Link to the major page on the Advising site',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
Expand All @@ -107,13 +111,16 @@ function uri_careers_create_program_post_type() {
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
array(
'key' => 'field_65ce19c20fb70',
'label' => 'Career Advisor Page',
'name' => 'advisor_page',
'label' => 'Career Advisor',
'name' => 'career_advisor',
'type' => 'text',
'instructions' => 'Link to the Career Advisor page',
'instructions' => 'Link to the Career Advisor',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
Expand All @@ -133,7 +140,7 @@ function uri_careers_create_program_post_type() {
'name' => 'industry_a_name',
'aria-label' => '',
'type' => 'text',
'instructions' => 'Industry A Name',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
Expand All @@ -153,7 +160,7 @@ function uri_careers_create_program_post_type() {
'name' => 'industry_a_entry_jobs',
'aria-label' => '',
'type' => 'text',
'instructions' => 'Industry A Entry Level Job Title (a)',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
Expand All @@ -173,7 +180,7 @@ function uri_careers_create_program_post_type() {
'name' => 'industry_a_experienced_jobs',
'aria-label' => '',
'type' => 'text',
'instructions' => 'Industry A Experienced job title (a)',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
Expand Down Expand Up @@ -308,9 +315,9 @@ function uri_careers_create_program_post_type() {
'append' => '',
),
array(
'key' => 'field_64e4fa903b09f',
'label' => 'Employers hiring our grads',
'name' => 'employers',
'key' => 'field_64e4fab93b0a0',
'label' => 'Grad Schools enrolling our students',
'name' => 'grad_schools',
'aria-label' => '',
'type' => 'text',
'instructions' => '',
Expand All @@ -328,9 +335,9 @@ function uri_careers_create_program_post_type() {
'append' => '',
),
array(
'key' => 'field_64e4fab93b0a0',
'label' => 'Grad Schools enrolling our students',
'name' => 'grad_schools',
'key' => 'field_64e4fa903b09f',
'label' => 'Employers hiring our grads',
'name' => 'employers',
'aria-label' => '',
'type' => 'text',
'instructions' => '',
Expand Down Expand Up @@ -373,7 +380,7 @@ function uri_careers_create_program_post_type() {
array(
'param' => 'post_type',
'operator' => '==',
'value' => 'majors',
'value' => 'career-data',
),
),
),
Expand Down
4 changes: 2 additions & 2 deletions inc/uri-careers-helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function uri_careers_render_skills() {
<div class="skills-columns">
<p>Across all majors, employers want to hire recent graduates who have the core skills that lead to a successful career. Ask your academic advisor which courses introduce or build upon these 8 Career Readiness competencies. After that, your Career Education Specialist (CES) can help you demonstrate these acquired skills and experiences in your resume.</p>
<div class="alumni-card">
<h3>Career Readiness for all majors:</h3>
<h3>Career Readiness for All Majors:</h3>
<div class="wp-block-columns">
<div class="wp-block-column">
Expand All @@ -184,7 +184,7 @@ function uri_careers_render_skills() {
if ( get_field( 'skills' ) ) {
$skills .= <<<spec_content
<div class="alumni-card">
<h3 id="major_specific_head"> $major skills:</h3>
<h3 id="major_specific_head"> $major Skills:</h3>
<p>These skills are recommended and ranked by URI alumni with this major.</p>
<ol>
{$uri_careers_skills_list('skills')}
Expand Down
24 changes: 12 additions & 12 deletions inc/uri-careers-shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,32 @@ function uri_careers_toggle_shortcode( $attributes, $shortcode ) {
// default attributes
$attributes = shortcode_atts(
array(
'majors' => null,
'careers' => null,
'major' => null,
'career' => null,
),
$attributes,
$shortcode
);

if ( null === $attributes['majors'] && null === $attributes['careers'] ) {
$button_careers = get_permalink();
$button_majors = get_permalink();
if ( null === $attributes['major'] && null === $attributes['career'] ) {
$button_career = get_permalink();
$button_major = get_permalink();
$button_style = array( 'disabled', 'disabled' );
}

if ( null !== $attributes['majors'] && null === $attributes['careers'] ) {
$button_careers = get_permalink();
$button_majors = $attributes['majors'];
if ( null !== $attributes['major'] && null === $attributes['career'] ) {
$button_career = get_permalink();
$button_major = $attributes['major'];
$button_style = array( '', 'prominent' );
$style_class = array( 'on', 'off' );
}
if ( null !== $attributes['careers'] && null === $attributes['majors'] ) {
$button_careers = $attributes['careers'];
$button_majors = get_permalink();
if ( null !== $attributes['career'] && null === $attributes['major'] ) {
$button_career = $attributes['career'];
$button_major = get_permalink();
$button_style = array( 'prominent', '' );
$style_class = array( 'off', 'on' );
}
return uri_careers_toggle( $button_careers, $button_majors, $button_style, $style_class );
return uri_careers_toggle( $button_career, $button_major, $button_style, $style_class );

}

Expand Down
4 changes: 2 additions & 2 deletions inc/uri-careers-templating.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ function uri_careers_locate_template( $template_name, $template_path = '', $defa
*/
function uri_careers_template_loader( $template ) {

if ( is_single() && get_post_type() === 'majors' ) {
if ( is_single() && get_post_type() === 'career-data' ) {

$file = 'single-major.php';
$file = 'single-career-data.php';

if ( file_exists( uri_careers_locate_template( $file ) ) ) {
$template = uri_careers_locate_template( $file );
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "uri-careers",
"description": "URI Careers",
"version": "1.0.3",
"version": "1.0.4",
"homepage": "https://www.uri.edu",
"repository": "https://github.com/uriweb/uri-careers",
"docs": "https://github.com/uriweb/uri-careers#readme",
Expand Down
10 changes: 5 additions & 5 deletions templates/single-major.php → templates/single-career-data.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

<div class="toggle">
<?php
if ( get_field( 'majors_link' ) ) {
$majors_link_toggle = get_field( 'majors_link' );
if ( get_field( 'advising_major' ) ) {
$major_link_toggle = get_field( 'advising_major' );

echo do_shortcode( '[uri-careers-toggle majors="' . $majors_link_toggle . '"]' );
echo do_shortcode( '[uri-careers-toggle major="' . $major_link_toggle . '"]' );
}
?>
</div>
Expand All @@ -26,8 +26,8 @@
<p class="banner-p">At the <a href="https://web.uri.edu/career/">Center for Career and Experiential Education (CCEE)</a>, your Career Education Specialist can introduce you to career paths and offer strategies to achieve your goals. To make an appointment, <a href="https://web.uri.edu/starfish/resources-for-students/">login to Starfish</a>.</p>

<?php
if ( get_field( 'advisor_page' ) ) {
$meetadvisor = get_field( 'advisor_page' );
if ( get_field( 'career_advisor' ) ) {
$meetadvisor = get_field( 'career_advisor' );
?>
<span class="banner-button">
<?php
Expand Down
4 changes: 2 additions & 2 deletions templates/toggle.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Create the toggle between the Advising and Careers page
*/
function uri_careers_toggle( $button_careers, $button_majors, $button_style, $style_class ) {
return '<div class="center">' . do_shortcode( '[cl-button class="' . $style_class[0] . '" link="' . $button_majors . '" text="Majors" style=' . $button_style[0] . '][cl-button class="' . $style_class[1] . '" link="' . $button_careers . '" text="Careers" style="' . $button_style[1] . '"]' ) .
function uri_careers_toggle( $button_career, $button_major, $button_style, $style_class ) {
return '<div class="center">' . do_shortcode( '[cl-button class="' . $style_class[0] . '" link="' . $button_major . '" text="Major" style=' . $button_style[0] . '][cl-button class="' . $style_class[1] . '" link="' . $button_career . '" text="Career" style="' . $button_style[1] . '"]' ) .
'</div>';
}
2 changes: 1 addition & 1 deletion uri-careers.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: URI Careers
* Plugin URI: http://www.uri.edu
* Description: A plugin to display Major and Career data
* Version: 1.0.3
* Version: 1.0.4
* Author: URI Web Communications
* Author URI: https://today.uri.edu/
*
Expand Down

0 comments on commit 0763c92

Please sign in to comment.