Skip to content

Commit

Permalink
Merge pull request #4 from uriweb/release-1.0.1
Browse files Browse the repository at this point in the history
Release 1.0.1
  • Loading branch information
alexandragauss authored Mar 20, 2024
2 parents a1ec2bd + 82d8b7e commit 0cd4be7
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 29 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.0
Stable tag: 1.0.1
2 changes: 1 addition & 1 deletion inc/uri-careers-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function uri_careers_create_program_post_type() {
array(
'key' => 'field_64dcf64afd993',
'label' => 'Majors Link',
'name' => 'careers_advising_link',
'name' => 'majors_link',
'aria-label' => '',
'type' => 'text',
'instructions' => 'Link to Majors page',
Expand Down
27 changes: 14 additions & 13 deletions inc/uri-careers-shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,39 @@
/**
* Create a shortcode for the toggle.
*/
function uri_careers_toggle_shortcode( $attributes ) {
function uri_careers_toggle_shortcode( $attributes, $shortcode ) {
// normalize attribute keys, lowercase
$attributes = array_change_key_case( (array) $attributes, CASE_LOWER );

// default attributes
$attributes = shortcode_atts(
array(
'advising_link' => null,
'careers_link' => null,
'majors' => null,
'careers' => null,
),
$attributes,
$shortcode
);

if ( null === $attributes['advising_link'] && null === $attributes['careers_link'] ) {
$link_careers = get_permalink();
$link_advising = get_permalink();
if ( null === $attributes['majors'] && null === $attributes['careers'] ) {
$button_careers = get_permalink();
$button_majors = get_permalink();
$button_style = array( 'disabled', 'disabled' );
}

if ( null !== $attributes['advising_link'] && null === $attributes['careers_link'] ) {
$link_careers = get_permalink();
$link_advising = $attributes['advising_link'];
if ( null !== $attributes['majors'] && null === $attributes['careers'] ) {
$button_careers = get_permalink();
$button_majors = $attributes['majors'];
$button_style = array( '', 'prominent' );
$style_class = array( 'on', 'off' );
}
if ( null !== $attributes['careers_link'] && null === $attributes['advising_link'] ) {
$link_careers = $attributes['careers_link'];
$link_advising = get_permalink();
if ( null !== $attributes['careers'] && null === $attributes['majors'] ) {
$button_careers = $attributes['careers'];
$button_majors = get_permalink();
$button_style = array( 'prominent', '' );
$style_class = array( 'off', 'on' );
}
return uri_careers_toggle( $link_careers, $link_advising, $button_style, $style_class );
return uri_careers_toggle( $button_careers, $button_majors, $button_style, $style_class );

}

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.0",
"version": "1.0.1",
"homepage": "https://www.uri.edu",
"repository": "https://github.com/uriweb/uri-careers",
"docs": "https://github.com/uriweb/uri-careers#readme",
Expand Down
11 changes: 7 additions & 4 deletions templates/single-major.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

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

echo do_shortcode( '[uri-careers-toggle advising_link="' . $advising . '"]' );
echo do_shortcode( '[uri-careers-toggle majors="' . $majors_link_toggle . '"]' );
}
?>
</div>
Expand All @@ -27,9 +27,12 @@

<?php
if ( get_field( 'advisor_page' ) ) {
$meetadvisor = get_field( 'advisor_page' );
?>
<span class="banner-button">
<a href="<?php $advisor_page; ?>">MEET YOUR CAREER EDUCATION SPECIALIST</a>
<?php
echo '<a href="' . $meetadvisor . '">MEET YOUR CAREER EDUCATION SPECIALIST</a>'
?>
</span>
<?php
}
Expand Down
9 changes: 3 additions & 6 deletions templates/toggle.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
/**
* Create the toggle between the Advising and Careers page
*/
function uri_careers_toggle( $link_careers, $link_advising, $button_style, $style_class ) {
if ( function_exists( 'uri_cl_shortcode_button' ) ) {
echo '<div class="center">';
echo do_shortcode( '[cl-button class="' . $style_class[0] . '" link="' . $link_advising . '" text="Majors" style=' . $button_style[0] . '][cl-button class="' . $style_class[1] . '" link="' . $link_careers . '" text="Careers" style="' . $button_style[1] . '"]' );
echo '</div>';
}
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] . '"]' ) .
'</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.0
* Version: 1.0.1
* Author: URI Web Communications
* Author URI: https://today.uri.edu/
*
Expand Down

0 comments on commit 0cd4be7

Please sign in to comment.