Plugin Directory

Changeset 1062596


Ignore:
Timestamp:
01/07/2015 10:58:50 PM (11 years ago)
Author:
Chrgiga
Message:

Save 1.0.3 version

Location:
css-file-selector
Files:
2 edited
3 copied

Legend:

Unmodified
Added
Removed
  • css-file-selector/tags/1.0.3/cssfileselector.php

    r1057455 r1062596  
    44Plugin URI: http://www.chrgiga.com/css-file-selector
    55Description: Add CSS files and/or CSS custom rules to any single page or post
    6 Version: 1.0.3
     6Version: 1.0.4
    77Author: Christian Gil
    88Author URI: http://www.chrgiga.com
     
    1616{
    1717    $screens = array( 'post', 'page' );
    18    
     18
    1919    foreach ($screens as $screen) {
    2020      add_meta_box(
     
    4141          } else {
    4242            // Ready File
    43             if (is_file($directory.'/'.$file) && end(explode('.', $file)) == 'css') {
     43            $explodefile = explode('.', $file);
     44
     45            if (is_file($directory.'/'.$file) && end($explodefile) == 'css') {
    4446              $files[dirname($directory.'/'.$file)][] = $directory.'/'.$file;
    4547            }
     
    8183    $select .= $option_css.'</select>';
    8284  }
    83  
     85
    8486  return $select;
    8587}
     
    107109function gil_css_file_selector_save_postdata($post_id)
    108110{
    109   // First we need to check if the current user is authorised to do this action. 
     111  // First we need to check if the current user is authorised to do this action.
    110112  if ('page' == $_POST['post_type']) {
    111113    if (!current_user_can( 'edit_page', $post_id)) {
     
    137139{
    138140  global $post;
    139  
     141
    140142  if (is_single() || is_page()) {
    141143    $cssfiles = get_post_meta($post->ID, 'gil_css_file_selector_file');
    142144
    143     if ($cssfiles[0] != '') {
     145    if (count($cssfiles) && $cssfiles[0] != '') {
    144146      foreach (explode(',', $cssfiles[0]) as $cssfile) {
    145147        $css_uri = str_replace(get_template_directory(), get_template_directory_uri(), $cssfile);
     
    153155{
    154156  global $post;
    155  
     157
    156158  if (is_single() || is_page()) {
    157159    $cssrules = get_post_meta($post->ID, 'gil_css_file_selector_rules');
    158     if ($cssrules[0] != '') { ?>
     160    if (count($cssrules) && $cssrules[0] != '') { ?>
    159161      <!-- CSS File Selector (custom rules) -->
    160162      <style type="text/css">
  • css-file-selector/tags/1.0.3/readme.txt

    r1057455 r1062596  
    55Requires at least: 3.0
    66Tested up to: 4.1
    7 Stable tag: 1.0.3
     7Stable tag: 1.0.4
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    3131== Changelog ==
    3232
     33= 1.0.4 =
     34* Solved a warning in debug mode.
     35
    3336= 1.0.3 =
    3437* Fixed a little error in the field select that showed the CSS files of the root path in the wrong folders. This little error did not prejudice the functionality of the plugin.
     
    4649== Upgrade Notice ==
    4750
     51= 1.0.4 =
     52* Solved a warning in debug mode.
     53
    4854= 1.0.3 =
    4955* Fixed a little error in the field select that showed the CSS files of the root path in the wrong folders. This little error did not prejudice the functionality of the plugin.
  • css-file-selector/trunk/cssfileselector.php

    r1057455 r1062596  
    44Plugin URI: http://www.chrgiga.com/css-file-selector
    55Description: Add CSS files and/or CSS custom rules to any single page or post
    6 Version: 1.0.3
     6Version: 1.0.4
    77Author: Christian Gil
    88Author URI: http://www.chrgiga.com
     
    1616{
    1717    $screens = array( 'post', 'page' );
    18    
     18
    1919    foreach ($screens as $screen) {
    2020      add_meta_box(
     
    4141          } else {
    4242            // Ready File
    43             if (is_file($directory.'/'.$file) && end(explode('.', $file)) == 'css') {
     43            $explodefile = explode('.', $file);
     44
     45            if (is_file($directory.'/'.$file) && end($explodefile) == 'css') {
    4446              $files[dirname($directory.'/'.$file)][] = $directory.'/'.$file;
    4547            }
     
    8183    $select .= $option_css.'</select>';
    8284  }
    83  
     85
    8486  return $select;
    8587}
     
    107109function gil_css_file_selector_save_postdata($post_id)
    108110{
    109   // First we need to check if the current user is authorised to do this action. 
     111  // First we need to check if the current user is authorised to do this action.
    110112  if ('page' == $_POST['post_type']) {
    111113    if (!current_user_can( 'edit_page', $post_id)) {
     
    137139{
    138140  global $post;
    139  
     141
    140142  if (is_single() || is_page()) {
    141143    $cssfiles = get_post_meta($post->ID, 'gil_css_file_selector_file');
    142144
    143     if ($cssfiles[0] != '') {
     145    if (count($cssfiles) && $cssfiles[0] != '') {
    144146      foreach (explode(',', $cssfiles[0]) as $cssfile) {
    145147        $css_uri = str_replace(get_template_directory(), get_template_directory_uri(), $cssfile);
     
    153155{
    154156  global $post;
    155  
     157
    156158  if (is_single() || is_page()) {
    157159    $cssrules = get_post_meta($post->ID, 'gil_css_file_selector_rules');
    158     if ($cssrules[0] != '') { ?>
     160    if (count($cssrules) && $cssrules[0] != '') { ?>
    159161      <!-- CSS File Selector (custom rules) -->
    160162      <style type="text/css">
  • css-file-selector/trunk/readme.txt

    r1057455 r1062596  
    55Requires at least: 3.0
    66Tested up to: 4.1
    7 Stable tag: 1.0.3
     7Stable tag: 1.0.4
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    3131== Changelog ==
    3232
     33= 1.0.4 =
     34* Solved a warning in debug mode.
     35
    3336= 1.0.3 =
    3437* Fixed a little error in the field select that showed the CSS files of the root path in the wrong folders. This little error did not prejudice the functionality of the plugin.
     
    4649== Upgrade Notice ==
    4750
     51= 1.0.4 =
     52* Solved a warning in debug mode.
     53
    4854= 1.0.3 =
    4955* Fixed a little error in the field select that showed the CSS files of the root path in the wrong folders. This little error did not prejudice the functionality of the plugin.
Note: See TracChangeset for help on using the changeset viewer.