Object oriented programming logic is very usefull if you want your code to reach your imagination limits. OOP helps your code to extend easier and at the same time helps your scripts to be cleaner, reusable, and saperated according to the logic you choose. Much stuff here is taken from the official php manual paraphrased and summarized by me in an efford to create a quick guide to PHP classes and objects. Most of the examples are mine and I tried to make them playful and educational.
Blog - page 3
PHP Classes - Oblects notes
$wpdb Class notes
WP Settings Api notes
CSS rules for responsive design
SEO basic concepts
PHP functions mini guide
PHP basic security measures mini guide
Common web attacks
Ξενοδοχείο φάντασμα Άντζελα
Internet is fun, but also a powerful tool to get instant information. Here I oppose some funny stuff I’ve found out there and also some tricks that might make your browsing easier and quicker.
Methods in the wpdb() class should not be called directly. Use the global $wpdb object instead.
$wpdb object can talk to any number of tables but only to one database.(*hyperdb)
Some of the methods in this class require from you to escape all untrusted values you incorporate.
$wpdb -> get_row( ‘query’, output_type, row_offset )
$wpdb -> get_col( ‘query’, column_offset )
$wpdb -> get_results( ‘query’, output_type )
$wpdb -> insert( $table, $data, $format )
$wpdb -> replace( $table, $data, $format )
$wpdb -> update( $table, $data, $where, $format=null, $where_format=null )
$wpdb -> delete( $table, $data, $where_format=null )
$wpdb -> query( ‘query’ )
$wpdb -> get_col_info( ‘type’, offset )
$wpdb -> show_errors()
$wpdb -> hide_errors()
$wpdb -> print_error()
The Settings API, lets you define settings pages, sections within those pages, and fields within the sections.
The form posts to wp-admin/options.php which provides strick capabilities checking and users will need to ‘manage_options’ capability to submit the form.
These are my quick notes for personal use, and they only resume the official wp codex.
Setting API functions
unregister_setting( $option_group, $option_name , $sanitize_callback )
add_settings_field( $id, $title, $callback, $page, $section, $args )
add_settings_section( $id, $title, $callback, $page )
setting_fields( $option_group )
do_settings_sections( $page )
do_settings_fields( $page, $section )
add_settings_error( $setting, $code, $message, $type )
get_settings_errors( $settings, $sanitize )
settings_errors( $setting, $sanitize, $hide_on_update )
I read bootstrap’s 3 code and here I will factor out some of the main concepts that I have found at their stylesheet(css).
I read their stylesheet for educational purposes, and because after all I don’t like overriding their sheet, or have 200 classes that I will never use for my projects. I also don’t like including their js files, and it seems that many css classes have connections with the js code.
By reading bootstrap’s code for the first time I narrowed down the code from 6 thousand lines to 1.5 thousand. And here’s the most interesting teqniques they use: