Skip to content

Instantly share code, notes, and snippets.

View feliciaceballos's full-sized avatar

Felicia Ceballos-Marroquin feliciaceballos

View GitHub Profile
<?php
/*
Single Post Template: Reports
Description: This part is optional, but helpful for describing the Post Template
*/
global $prefix;
wp_head(); ?>
<table id="download">
<?php
/*
Single Tag Template: Fronter
Description: This part is optional, but helpful for describing the Post Template
*/
global $prefix;
wp_head(); ?>
<body style="padding: 50px;">
<?php
/*
Title: Employee Information
Description: This area is for administrative purposes
Capability: manage_options
*/
// Let's create a text box field
piklist('field', array(
'type' => 'text'
@feliciaceballos
feliciaceballos / forminator-example.txt
Created September 25, 2018 02:09
New Client Questionnaire
{"type":"form","data":{"fields":[{"id":"section-1","element_id":"section-1","form_id":"wrapper-1537827779502-1868","condition_action":"show","condition_rule":"any","conditions":[],"type":"section","options":[],"cols":12,"section_title":"Project Leader","section_border":"false","section_subtitle":"","custom-class":"","wrapper_id":"wrapper-1537827779502-1868"},{"id":"name-1","element_id":"name-1","form_id":"wrapper-1511347711918-1669","condition_action":"show","condition_rule":"any","conditions":[],"type":"name","cols":4,"required":"true","field_label":"Project Leader Name","placeholder":"E.g. John","prefix_label":"Prefix","fname_label":"First Name","fname_placeholder":"E.g. John","mname_label":"Middle Name","mname_placeholder":"E.g. Smith","lname_label":"Last Name","lname_placeholder":"E.g. Doe","prefix_description":"","fname_description":"","mname_description":"","lname_description":"","description":"","custom-class":"","wrapper_id":"wrapper-1511347711918-1669"},{"id":"email-1","element_id":"email-1","form_id
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-recent-entries-dashboard-widget.pho
Created October 24, 2018 19:03
Plugin Extension for Forminator to Display Forminator Form Entries in WordPress Dashboard Widget
<?php
/*
Plugin Name: Forminator Recent Entries Dashboard Widget
Plugin URI: https://premium.wpmudev.org/project/forminator-pro/
Description: Display Forminator Form Entries in WordPress Dashboard Widget
Version: 0.1
Author: Cvetan Cvetanov
Author URI: https://premium.wpmudev.org/profile/cvetan
*/
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-recent-entries-dashboard-widget-12.php
Created October 24, 2018 19:43
Plugin Extension for Forminator to Display Forminator Form Entries in WordPress Dashboard Widget
public function reset_options() {
// Fetch ALL dashboard widget options from the db...
$opts = get_option( 'dashboard_widget_options' );
//Get just our widget's options, or set default
unset( $opts[ __CLASS__ ] );
// update option
return update_option( 'dashboard_widget_options', $opts );
}
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-recent-entries-dashboard-widget-11.php
Created October 24, 2018 19:43
Plugin Extension for Forminator to Display Forminator Form Entries in WordPress Dashboard Widget
public function update_options( $options = array() ) {
// Fetch all dashboard widget options from the db...
$opts = get_option( 'dashboard_widget_options' );
//Get just our widget's options, or set empty array
$forminator_options = ( isset( $opts[ __CLASS__ ] ) ) ? $opts[ __CLASS__ ] : array();
// merge old one with new one
$opts[ __CLASS__ ] = array_merge( $forminator_options, $options );
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-recent-entries-dashboard-widget-10.php
Created October 24, 2018 19:43
Plugin Extension for Forminator to Display Forminator Form Entries in WordPress Dashboard Widget
public function configure() {
// Check if user allowed to view the widget
if ( ! $this->user_allowed() ) {
echo esc_html( __( 'You are not allowed to view this widget content' ) );
} else {
$options = $this->get_options( $this->get_default_options() );
$post_data = $_POST;
if ( isset( $post_data['id'] ) ) {
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-recent-entries-dashboard-widget-09.php
Created October 24, 2018 19:43
Plugin Extension for Forminator to Display Forminator Form Entries in WordPress Dashboard Widget
public function render_form_submissions( $form, $entries ) {
$field_labels = array();
// Get fields labels
if ( ! is_null( $form ) ) {
if ( is_array( $form->fields ) ) {
foreach ( $form->fields as $field ) {
$field_labels[ $field->slug ] = $field->get_label_for_entry();
}
}
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-recent-entries-dashboard-widget-08.php
Created October 24, 2018 19:43
Plugin Extension for Forminator to Display Forminator Form Entries in WordPress Dashboard Widget
protected function get_submissions() {
// Check if we have configured form ID else return
if ( empty( $this->id ) ) {
echo esc_html( __( 'Please configure which form to display its submissions.' ) );
return false;
}
$module = null;
$entries = array();