Top Poster
#1 ramon fincken 401
#2 Site admin 3
#3 Ber|Art 2
#4 braddmark 1
#5 accentmedia 1
#6 Xarzu 1
#7 pEcosespedex 1
#8 khadish 1
#9 moxxx 1
#10 nistelrock 1

The time now is Tue Nov 24, 2020 9:56 am
Ramonfincken.com Forum Index
View unanswered posts
[WordPress] creating PHP patches for WordPress Make Core and setting it up
Author ramon fincken :: Posted: Fri Oct 30, 2020 8:40 am :: Category: CMS-ses (Joomla, WordPress, etc..)


Do you want to contribute your PHP skills to WordPress Core?


Use this manual to get started !


# For to make PHP patches Razz To make children happy
# https://make.wordpress.org/core/handboo...dards/php/

# Download
svn co https://develop.svn.wordpress.org/trunk wordpress_make
cd wordpress_make

# JS and CSS
npm install
npm run build
npm run dev

copy wp-config-sample.php to wp-config.php and edit accordingly (do not forget to create a new DB !)


# Install and do your coding


# PHP unit test
# https://make.wordpress.org/core/handboo...g/phpunit/

#WARNING: You might need to install an older version
sudo apt install phpunit
copy wp-tests-config-sample.php to wp-tests-config.php and edit accordingly (do not forget to create a *new* DB !)

phpunit
or



# Patch and submit to trac
# https://make.wordpress.org/core/handboo...g-a-patch/
svn diff filename.php > filename.diff


[fix] How to add the clock seconds to ubuntu 20.04
Author ramon fincken :: Posted: Tue Aug 04, 2020 6:27 am :: Category: Ubuntu


Code:
sudo apt install dconf-editor


Then open dconf GUI

Search for "seconds" or go to /org/gnome/desktop/interface/clock-show-seconds

Enable!





Related read: https://ubuntu-mate.community/t/20-04-m...l/21795/21


[solution] htaccess rewrite to parent folder
Author ramon fincken :: Posted: Fri Dec 13, 2019 12:23 pm :: Category: PHP coding


when some idiot decides to put a whole site in a (dated) subfolder like

www/2018/

and you want to migrate to another host and set things strait ( meaning www/ ) you will end up with A LOT OF 404 urls

You need to create a 2018 folder and put this in your htaccess to redirect 301 all requests to the parent root folder

Code:
RewriteRule ^(.*)$ https://www.fulldomain.ext/$1 [R=301,L]


[chrome] re-add (unhide) www in address bar
Author ramon fincken :: Posted: Thu Oct 31, 2019 1:34 pm :: Category: Ubuntu


visit
Code:
chrome://flags/#omnibox-ui-hide-steady-state-url-scheme-and-subdomains


set
Omnibox UI Hide Steady-State URL Trivial Subdomains

to Disabled and restart to see the www. again.


[solution] composer "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
Author ramon fincken :: Posted: Mon Sep 02, 2019 3:08 pm :: Category: Bash, perl, python and CLI linux


Code:
composer install


Code:
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?



if it is NOT your PHP (when as zip); don't forget to update your composer!!
Code:
find . -type f -name '*.php' -exec php -l {} \; |grep -v "No syntax errors detected"



Ubuntu:
Code:
/usr/local/bin/composer self-update


[date] Find booking date overlap
Author ramon fincken :: Posted: Fri Jul 05, 2019 7:24 am :: Category: PHP coding
Tagged: , ,


Booking date checker: start & end = guest wish date.
Must NOT overlap with any known availability start-end periods.


Code:

start-end is exactly the same as non-availability start-end
OR
start-end is within the range as non-availability start-end

start is within the range as non-availability start-end

end is within the range as non-availability start-end


https://pastebin.com/cjYSAGf5


[solution] WordPress a3 Lazy Load plugin Background image inline
Author ramon fincken :: Posted: Tue Jun 18, 2019 11:25 am :: Category: CMS-ses (Joomla, WordPress, etc..)


The WordPress a3 Lazy Load does not work for background images in HTML.

The lazy load javascript comes from https://github.com/ressio/lazy-load-xt

its readme shows this nice example: http://ressio.github.io/lazy-load-xt/demo/bg.htm


steps to enable background image lazy loading for WordPress:

  • Download jquery.lazyloadxt.bg.js from https://github.com/ressio/lazy-load-xt/...adxt.bg.js into yourtheme/dist/js/jquery.lazyloadxt.bg.js
  • Use this in your theme functions.php file
    Code:


    add_action( 'wp_enqueue_scripts',  'enqueue_javascripts' );

    function enqueue_javascripts() {
              /**
               * https://github.com/ressio/lazy-load-xt
               * http://ressio.github.io/lazy-load-xt/demo/bg.htm
               */
              $in_footer = true; // Overwrite any setting from a3 lazy loading
              wp_register_script( 'jquery-lazyloadxt-bg',
                  get_template_directory_uri().'/dist/js/jquery.lazyloadxt.bg.js',
                  array( 'jquery', 'jquery-lazyloadxt', 'jquery-lazyloadxt-srcset', 'jquery-lazyloadxt-extend' ),
                  A3_LAZY_VERSION,
                  $in_footer );
              wp_enqueue_script( 'jquery-lazyloadxt-bg' );
    }

  • Convert your background HTML element URL calls like:
    Code:
    style="background-image: url(image_url.jpg)"

    to:
    Code:
    data-bg="image_url.jpg"




done!


[wordpress][woocommerce] Get all order notes
Author ramon fincken :: Posted: Fri May 10, 2019 7:28 am :: Category: CMS-ses (Joomla, WordPress, etc..)


First remove the filter that does NOT allow to query the order_notes
Code:
remove_filter('comments_clauses', array( 'WC_Comments' ,'exclude_order_comments'), 10, 1 );


Now, get the comments
Code:
$comments = get_comments( [ 'post_id' => $wc_order->get_id(), 'comment_type' => 'order_note' ]);



@see class-wc-comments.php
Code:
   /**
    * Exclude order comments from queries and RSS.
    *
    * This code should exclude shop_order comments from queries. Some queries (like the recent comments widget on the dashboard) are hardcoded.
    * and are not filtered, however, the code current_user_can( 'read_post', $comment->comment_post_ID ) should keep them safe since only admin and.
    * shop managers can view orders anyway.
    *
    * The frontend view order pages get around this filter by using remove_filter('comments_clauses', array( 'WC_Comments' ,'exclude_order_comments'), 10, 1 );
    *
    * @param  array $clauses A compacted array of comment query clauses.
    * @return array
    */
   public static function exclude_order_comments( $clauses ) {
      $clauses['where'] .= ( $clauses['where'] ? ' AND ' : '' ) . " comment_type != 'order_note' ";
      return $clauses;
   }


All times are GMT
Who is Online
Who is Online Our users have posted a total of 407 articles
We have 26 registered users
The newest registered user is MathewCow
In total there is 1 user online :: 0 Registered, 0 Hidden and 1 Guest   [ Administrator ]   [ Moderator ]
Most users ever online was 41 on Wed Sep 09, 2015 1:34 am
Registered Users: None
This data is based on users active over the past five minutes
Log in
Username:    Password:      Log me on automatically each visit    

New posts New posts    No new posts No new posts    Forum is locked Forum is locked
General forums
The world of freelance
Programming
Other projects
Poll
I love gifts

Yes goodies and presents! [3]
No but I love polls ! [1]

Related google ads