Skip to content

Commit

Permalink
Merge pull request #95 from navnorth/stage
Browse files Browse the repository at this point in the history
0.9.2 release
  • Loading branch information
johnpaulbalagolan authored Oct 14, 2022
2 parents a33024e + 7c4baff commit 1d7575f
Show file tree
Hide file tree
Showing 23 changed files with 215 additions and 124 deletions.
24 changes: 14 additions & 10 deletions blocks/resource-block/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,13 @@ function oer_display_resource_block( $attributes, $ajax = false ){

<?php if ($showGrades=="true"):
$grade_levels = oer_resource_block_grade_levels($resource->ID);
if ($grade_levels):
?>
<div class="oer-resource-block-grade-levels">
<strong><?php esc_html_e('Grade Levels', OER_SLUG); ?>: </strong> <?php echo esc_html($grade_levels); ?>
</div>
<?php endif; ?>
<div class="oer-resource-block-grade-levels">
<strong><?php esc_html_e('Grade Levels', OER_SLUG); ?>: </strong> <?php echo esc_html($grade_levels); ?>
</div>
<?php endif;
endif; ?>
</div>

<?php
Expand All @@ -174,12 +176,14 @@ function oer_resource_block_subjects($resource_id){
$subjects = array();
$subj_arr = get_the_terms($resource_id, 'resource-subject-area');

foreach ($subj_arr as $subj){
$subjects[] = array(
"term_id" => $subj->term_id,
"name" => $subj->name,
"term_link" => get_term_link($subj->term_id,'resource-subject-area')
);
if (is_array($subj_arr)){
foreach ($subj_arr as $subj){
$subjects[] = array(
"term_id" => $subj->term_id,
"name" => $subj->name,
"term_link" => get_term_link($subj->term_id,'resource-subject-area')
);
}
}
return $subjects;
}
Expand Down
2 changes: 1 addition & 1 deletion blocks/subject-resources-block-v2/build/style-index.css

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

6 changes: 5 additions & 1 deletion blocks/subject-resources-block-v2/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,11 @@ function oer_ajax_get_subject_resources(){
// Sanitize POST parameters
$params = array();
$params['action'] = sanitize_text_field($_POST['action']);
$params['attributes'] = $_POST['attributes'];
if (isset($_POST['attributes']))
$params['attributes'] = $_POST['attributes'];
else
$params['attributes'] = $_POST;

array_walk($params['attributes'], function(&$value, &$key){
$value['displayCount'] = sanitize_text_field($value['displayCount']);
$value['sort'] = sanitize_text_field($value['sort']);
Expand Down
11 changes: 6 additions & 5 deletions css/back_styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ ul.oer_slctstandard > li
border: 1px solid #cccccc;
padding-left: 10px;
}
.oer-plugin-footer { margin:10px 0 0; }
.oer-plugin-info { display:inline-block; }
.oer-plugin-link { display:inline-block; margin-left:10px; }
.oer-plugin-footer { margin:10px 0 0; font-size:0.9em; }
.oer-plugin-info { display:inline-block; width: 49%; }
.oer-plugin-link { display:inline-block; margin-left:10px; width:48%; text-align:right; }
.clear { clear:both; }
#col-standards-left { width:40%; float:left; }
#col-standards-left .oer_pargrph { width:auto; float:none; }
Expand All @@ -221,8 +221,9 @@ ul.oer_slctstandard > li
.oer-plugin-row:first-child, .oer-import-row:first-child { padding:15px 15px 0; }
.oer-import-row:first-child { padding:10px 0 0; }
.oer-import-row { padding:0; }
.oer-plugin-row .oer-row-left, .oer-import-row .row-left { width:63%; float:left; }
.oer-plugin-row .oer-row-right, .oer-import-row .row-right { width:35%; float:right; }
.oer-import-row .row-left .fields table.form-table td label { display:inline; }
.oer-plugin-row .oer-row-left, .oer-import-row .row-left { width:68%; float:left; }
.oer-plugin-row .oer-row-right, .oer-import-row .row-right { width:30%; float:right; }
.oer-import-row .row2-left { width:85%; float:left; }
.oer-import-row .row2-right { width:13%; float:right; }
.oer-plugin-row fieldset, .oer-import-row fieldset { margin-bottom:15px; }
Expand Down
10 changes: 9 additions & 1 deletion css/front_styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ li.oer_sbstndard{
.search-results .type-resource .entry-header h2.entry-title { margin-bottom:0; }
.search-results .type-resource .entry-header h5.post-meta { margin-bottom:1.05em; }
.search-results .type-resource .entry-header h5.post-meta .post-meta-box { margin-right:15px; }
.search-results #content #posts-container .pagination { margin-bottom:20px; }
article.oer_sngl_resource_wrapper div#sngl-resource header.entry-header h1.entry-title {font-size: 20px; line-height: 30px;}
.oer-standards #content, .standards-template #content,
.substandards-template #content, .notation-template #content { width:100%; }
Expand Down Expand Up @@ -659,4 +660,11 @@ div#oer_related_resources_list label input {
.twenty-thirteen .wp-block-wp-oer-plugin-wp-oer-subjects-index .oer-cntnr .oer-ctgry-cntnr .oer_snglctwpr .oer-cat-div .oer-cat-txt-btm-cntnr ul li span:last-child { position:absolute; top:0; right:0; }
.twenty-twelve .wp-block-wp-oer-plugin-wp-oer-subjects-index .oer-cntnr .oer-ctgry-cntnr .oer_snglctwpr .oer-cat-div .oer-cat-txt-btm-cntnr ul li { margin-top:35px; margin-left:0; }
.twenty-twelve .wp-block-wp-oer-plugin-wp-oer-subjects-index .oer-cntnr .oer-ctgry-cntnr .oer_snglctwpr .oer-cat-div .oer-cat-txt-btm-cntnr ul li .oer-mne-sbjct-ttl { width:45%; }
.oer-subject-resources-list .oer-snglrsrc .oer-snglttldscrght .tagcloud span { margin:10px 0; }
.oer-subject-resources-list .oer-snglrsrc .oer-snglttldscrght .tagcloud span { margin:10px 0; }
.tc-oer-subject-areas-list li.lp-subject-hidden i {
display: inline-flex;
flex-direction: column;
justify-content: center;
margin-left: 3px;
margin-right: 3px;
}
1 change: 1 addition & 0 deletions css/resource-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ p.center { text-align:center; }
.oer-lp-full-content {
display: none;
}
.oer-lp-full-content .bx-wrapper.mobile .featuredwpr_bxslider li { width:375px !important; }
.oer-lp-full-content pre {
white-space: normal !important;
}
Expand Down
6 changes: 3 additions & 3 deletions includes/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@
</div>
</div>
</div><!-- /.wrap -->
<div class="plugin-footer">
<div class="plugin-info"><?php echo OER_ADMIN_PLUGIN_NAME . " " . OER_VERSION .""; ?></div>
<div class="plugin-link"><a href="<?php echo esc_url('https://www.wp-oer.com/') ?>" target="_blank"><?php esc_html_e("More Information", OER_SLUG); ?></a></div>
<div class="oer-plugin-footer">
<div class="oer-plugin-info"><?php echo OER_ADMIN_PLUGIN_NAME . " " . OER_VERSION .""; ?></div>
<div class="oer-plugin-link"><a href="<?php echo esc_url('https://www.wp-oer.com/') ?>" target="_blank"><?php esc_html_e("More Information", OER_SLUG); ?></a></div>
<div class="clear"></div>
</div>
<?php oer_display_loader(); ?>
29 changes: 20 additions & 9 deletions includes/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,17 +385,16 @@ function oer_update_subject_area_meta( $term_id, $tt_id ){
function oer_save_customfields()
{
global $post, $wpdb, $_oer_prefix;

//Check first if screenshot is enabled
$screenshot_enabled = get_option( 'oer_enable_screenshot' );
$external_screenshot = get_option('oer_external_screenshots');

//Check first if $post is not empty
if ($post) {
if($post->post_type == 'resource')
{
if (isset($_GET['action']) && (sanitize_text_field($_GET['action'])=="trash" || sanitize_text_field($_GET['action'])=="untrash")){
return;
if($post->post_type == 'resource'){
if (isset($_GET['action']) && (sanitize_text_field($_GET['action'])=="trash" || sanitize_text_field($_GET['action'])=="untrash")){
return;
}
if (!isset($_POST['oer_metabox_nonce_field']) || !wp_verify_nonce( $_POST['oer_metabox_nonce_field'], 'oer_metabox_action' )) {
wp_die('Nonce verification failed');
Expand Down Expand Up @@ -427,20 +426,20 @@ function oer_save_customfields()
{
update_post_meta( $post->ID , 'oer_grade' , '');
}

// Save Age Levels
// Save Age Levels
if(isset($_POST['oer_age_levels']))
{
update_post_meta( $post->ID , 'oer_age_levels' , sanitize_text_field($_POST['oer_age_levels']));
}

// Save Instructional Time
// Save Instructional Time
if(isset($_POST['oer_instructional_time']))
{
update_post_meta( $post->ID , 'oer_instructional_time' , sanitize_text_field($_POST['oer_instructional_time']));
}

// Save Creative Commons License
// Save Creative Commons License
if(isset($_POST['oer_creativecommons_license']))
{
update_post_meta( $post->ID , 'oer_creativecommons_license' , sanitize_text_field($_POST['oer_creativecommons_license']));
Expand Down Expand Up @@ -558,11 +557,17 @@ function oer_save_customfields()
if(isset($_POST['oer_authortype2']))
{
update_post_meta( $post->ID , 'oer_authortype2' , sanitize_text_field($_POST['oer_authortype2']));
} else {
if (get_post_meta($post->ID, 'oer_authortype2'))
delete_post_meta($post->ID, 'oer_authortype2');
}

if(isset($_POST['oer_authorname2']))
{
update_post_meta( $post->ID , 'oer_authorname2' , sanitize_text_field($_POST['oer_authorname2']));
} else {
if (get_post_meta($post->ID, 'oer_authorname2'))
delete_post_meta($post->ID, 'oer_authorname2');
}

if(isset($_POST['oer_authorurl2']))
Expand All @@ -576,11 +581,17 @@ function oer_save_customfields()
}
}
update_post_meta( $post->ID , 'oer_authorurl2' , $oer_authorurl2);
} else {
if (get_post_meta($post->ID, 'oer_authorurl2'))
delete_post_meta($post->ID, 'oer_authorurl2');
}

if(isset($_POST['oer_authoremail2']))
{
update_post_meta( $post->ID , 'oer_authoremail2' , sanitize_email($_POST['oer_authoremail2']));
} else {
if (get_post_meta($post->ID, 'oer_authoremail2'))
delete_post_meta($post->ID, 'oer_authoremail2');
}

if(isset($_POST['oer_publishername']))
Expand Down
Loading

0 comments on commit 1d7575f

Please sign in to comment.