Skip to content

Instantly share code, notes, and snippets.

View feliciaceballos's full-sized avatar

Felicia Ceballos-Marroquin feliciaceballos

View GitHub Profile
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-submissions-dashboard-widget-07.php
Last active October 29, 2018 21:44
Create the WPMU DEV Forminator Recent Submissions Dashboard Widget, Configure Widget Settings
<?php
/**
* Configure Widget
* Configure form id and entries limit
*/
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 {
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-submissions-dashboard-widget-06.php
Last active November 7, 2018 19:31
Create the WPMU DEV Forminator Recent Submissions Dashboard Widget, Verifying User Permissions
<?php
/**
* Setup permissions here if needed
*
* @return bool
*/
public function user_allowed() {
return true;
}
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-submissions-dashboard-widget-05.php
Last active October 29, 2018 21:44
Create the WPMU DEV Forminator Recent Submissions Dashboard Widget, Construct Method the Register Widget
<?php
/**
* Add prerequisites if needed
*/
public function __construct() {
}
/**
* Register the dashboard widget
*/
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-submissions-dashboard-widget-04.php
Last active October 29, 2018 21:44
Create the WPMU DEV Forminator Recent Submissions Dashboard Widget, Get Class Instance
<?php
/**
* Get instance
*
* @return Forminator_Submissions_Dash_Widget
*/
public static function get_instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-submissions-dashboard-widget-03.php
Last active October 29, 2018 21:44
Create the WPMU DEV Forminator Recent Submissions Dashboard Widget, Creating the Class
<?php
/**
* Class Forminator_Submissions_Dash_Widget.
*
*/
class Forminator_Submissions_Dash_Widget {
/**
* Class instance
*
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-submissions-dashboard-widget-02.php
Last active October 29, 2018 21:44
Create the WPMU DEV Forminator Recent Submissions Dashboard Widget, Creating the Widget
<?php
function forminator_dash_widget() {
// Widget should be added after `wp_dashboard_setup` hook called.
add_action( 'wp_dashboard_setup', 'add_forminator_dash_widget' );
}
function add_forminator_dash_widget() {
// Instantiate Forminator_Submissions_Dash_Widget class.
$widget = Forminator_Submissions_Dash_Widget::get_instance();
$widget->register_widget();
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-submissions-dashboard-widget-01.php
Last active October 29, 2018 21:35
Create the WPMU DEV Forminator Recent Submissions Dashboard Widget Step 1
<?php
/**
* Plugin Name: Forminator Dashboard Widget
* Version: 1.0
* Plugin URI: https://premium.wpmudev.org/project/forminator/
* Description: Display latest form submissions as Dashboard Widget
* Author: WPMU DEV
* Author URI: http://premium.wpmudev.org
*/
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-recent-entries-dashboard-widget.php
Created October 24, 2018 20:01
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-01.php
Last active October 29, 2018 19:18
Plugin Extension for Forminator to Display Forminator Form Entries in WordPress Dashboard Widget
class Forminator_Submissions_Dash_Widget {
private static $instance = null; // Here we store class instance
private $id = null; // Form ID that we will retrieve submissions from
private $limit = 5; // Number of displayed submissions in widget
public function __construct() {
// Construct method
@feliciaceballos
feliciaceballos / wpmu-dev-forminator-recent-entries-dashboard-widget-02.php
Created October 24, 2018 19:44
Plugin Extension for Forminator to Display Forminator Form Entries in WordPress Dashboard Widget
/*
* Get class instance
* We will need that to instantiate our plugin class
*/
public static function get_instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;