Skip to content

Instantly share code, notes, and snippets.

@wpweb101
wpweb101 / self-closing-element-correct.html
Created April 15, 2021 06:52
Correct Self closing element
<br/>
<hr/>
@wpweb101
wpweb101 / quotes-incorrect.html
Created April 15, 2021 06:36
Quotes Incorrect
<html>
<body>
<table>
<tr>
<td colspan=3>
<input type="text" disabled>
</td>
</tr>
</table>
</body>
@wpweb101
wpweb101 / quotes-correct.html
Created April 15, 2021 06:35
Quotes Correct
<html>
<body>
<table>
<tr>
<td colspan="3">
<input type="text" disabled="disabled">
</td>
</tr>
</table>
</body>
@wpweb101
wpweb101 / indentation-incorrect.php
Created April 15, 2021 06:27
Indentation incorrect code
<?php
if( have_post())
{
echo get_the_title();
}
@wpweb101
wpweb101 / indentation-correct.php
Created April 15, 2021 06:24
Indentation - Correct
<?php
if( have_post() ) {
echo get_the_title();
}
else {
echo 'No post found!';
}
@wpweb101
wpweb101 / edd-vou-pdf-generate-fonts.php
Created September 25, 2020 07:43
EDD PDF Vouchers - Change PDF Font
<?php
function edd_vou_pdf_modify_generate_fonts( $pdf_font ) {
// by default the font type is "helvetica"
//Remember : The font should be in tcpdf folder ( edd-pdf-vouchers/includes/tcpdf/fonts )
$pdf_font = 'freeserif';
return $pdf_font;
}
<?php
add_filter('woo_vou_gift_notification_data', 'wpw_woo_vou_remove_downloadfile_text',10,1);
function wpw_woo_vou_remove_downloadfile_text($gift_data){
if( isset($gift_data['voucher_link'])){
$gift_data['voucher_link'] = str_replace('Download file', '', $gift_data['voucher_link']); // download file should be the exact that you want to remove
}
return $gift_data;
// Add filter to add custom css
add_filter ( 'woo_vou_check_qrcode_cstm_style', 'woo_vou_allow_admin_to_bcc_func' );
function woo_vou_allow_admin_to_bcc_func ( $style ) {
return '<style>..woo-vou-check-code tbody tr:last-child td input { display: none;} .success { background-color: #dd9933; color: white;} </style>';
}
@wpweb101
wpweb101 / wpw-auto-poster-manage-schedules-per-page.php
Created July 30, 2020 13:53
Social Auto Poster - Change the number of record per page for the manage schedule page
<?php
// code to Change the number of record per page for the manage schedule page
function wpw_auto_poster_manage_schedule_page_record( $per_page ){
return '20'; // You can set the number of record per page
}
add_filter('wpw_auto_poster_manage_schedules_per_page','wpw_auto_poster_manage_schedule_page_record');
@wpweb101
wpweb101 / woo_slg_custom_login_redirection_url.php
Last active May 27, 2020 10:53
woocommerce social login force custom redirection
<?php
function woo_slg_custom_login_redirection_url( $redirect_url ) {
global $woo_slg_options, $pagenow, $woo_slg_model;
// Force to use settings page redirection url
if( ! empty($woo_slg_options['woo_slg_redirect_url']) ) {
$redirect_url = $woo_slg_options['woo_slg_redirect_url'];
}