Skip to content

Instantly share code, notes, and snippets.

View ivanildodias's full-sized avatar

Ivanildo Dias ivanildodias

  • Estúdio Viking
  • Fortaleza - CE - Brasil
View GitHub Profile
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
class WordPress_Plugin_Template_Settings {
private $dir;
private $file;
private $assets_dir;
private $assets_url;
private $settings_base;
@ivanildodias
ivanildodias / Remove novalidate Comment Form Wordpress
Last active July 30, 2019 07:56
Remove "novalidate" attribute in default WordPress Comment Form
ob_start();
$commenter = wp_get_current_commenter();
$req = get_option( 'require_name_email' );
$aria_req = ( $req ? " aria-required='true'" : '' );
$html_req = ( $req ? " required='required'" : '' );
$span_req = ( $req ? ' <span class="required">*</span>' : '' );
comment_form( array(
'title_reply' => __( 'Leave your thoughts', 'issimple' ),
'comment_notes_after' => '',
@ivanildodias
ivanildodias / get-first-image.php
Last active October 1, 2015 21:22
Retornar a primeira imagem do post [Get the first post image]
<?php
/**
* Retorna a tag <img> com a primeira imagem de um post. Caso o post não tenha imagens,
* retorna uma imagem padrão.
*/
function get_first_image( $args = array() ) {
global $post, $posts;
$args = wp_parse_args( $args, array(
'native_class' => true,