Skip to content

Instantly share code, notes, and snippets.

View JMWebDevelopment's full-sized avatar

Jacob Martella Web Development JMWebDevelopment

View GitHub Profile
@JMWebDevelopment
JMWebDevelopment / Sports Bench Game Admin Customizations
Created May 14, 2022 14:44
Sports Bench Game Admin Customizations
function open_cup_edit_game_details( $game ) {
?>
<div class="game-details">
<h2><?php esc_html_e( 'Game Information', 'sports-bench' ); ?></h2>
<div class="field one-column">
<label for="game-status"><?php esc_html_e( 'Status', 'sports-bench' ); ?></label>
<select id="game-status" name="game_status">
<option value="" <?php selected( $game['game_status'], '' ); ?>><?php esc_html_e( 'Select a Status', 'sports-bench' ); ?></option>
<option value="scheduled" <?php selected( $game['game_status'], 'scheduled' ); ?>><?php esc_html_e( 'Scheduled', 'sports-bench' ); ?></option>
<option value="in_progress" <?php selected( $game['game_status'], 'in_progress' ); ?>><?php esc_html_e( 'In Progress', 'sports-bench' ); ?></option>
<?php
/**
* WP_Rig\WP_Rig\Theme class
*
* @package wp_rig
*/
namespace WP_Rig\WP_Rig;
use InvalidArgumentException;
@JMWebDevelopment
JMWebDevelopment / Custom WP Rig Component
Created August 22, 2020 22:20
/inc/Categories/Component.php
<?php
/**
* WP_Rig\WP_Rig\Categories\Component class
*
* @package wp_rig
*
* This file should be inside your /inc/Categories directory.
*/
namespace WP_Rig\WP_Rig\Categories;
jQuery( function() {
$( ".sports-bench-playoff-modal" ).dialog({
autoOpen: false,
show: {
effect: "blind",
duration: 1000
},
hide: {
effect: "explode",
duration: 1000
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'jquery-ui-dialog' );
wp_enqueue_style( '//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css' );
function sports_bench_do_playoff_series_modal( $html, $series, $team_one, $team_one_name, $team_two, $team_two_name, $game_numbers ) {
$html .= '<div class="reveal sports-bench-playoff-modal" id="series-' . $series->series_id . '" data-reveal>';
$html .= '<table class="series-modal-top">';
$html .= '<tr>';
$html .= '<td class="modal-logo">' . $team_one->get_team_photo( 'team-logo' ) . '</td>';
$html .= '<td class="modal-team-name team-one-name">' . $team_one_name . '</td>';
$html .= '<td class="modal-score">' . $series->get_series_score() . '</td>';
$html .= '<td class="modal-team-name team-two-name">' . $team_two_name . '</td>';
$html .= '<td class="modal-logo">' . $team_two->get_team_photo( 'team-logo' ) . '</td>';
$html .= '</tr>';
function sports_bench_do_playoff_series( $html, $series, $team_one, $team_one_class, $team_one_name, $team_two, $team_two_class, $team_two_name, $game_numbers ) {
$html .= '<table>';
$team_row_styles = apply_filters( 'sports_bench_playoff_team_row', '', $team_one );
$html .= '<tr class="team-row" style="' . $team_row_styles . '">';
$html .= '<td class="seed">' . $series->team_one_seed . '</td>';
$html .= '<td class="logo">' . $team_one->get_team_photo( 'team-logo' ) . '</td>';
$html .= '<td class="name ' . $team_one_class . '">' . $team_one_name . '</td>';
$html .= '<td class="score">' . $series->get_team_score( 'team-one' ) . '</td>';
$html .= '</tr>';
$team_row_styles = apply_filters( 'sports_bench_playoff_team_row', '', $team_two );
class JM_Portfolio_Blocks {
protected $loader;
protected $directory_location;
public function __construct() {
$this->directory_location = str_replace( '/blocks/', '', dirname( __FILE__ ) );
}
public function jm_portfolio_add_scripts() {
class JM_Portfolio {
protected $loader;
protected $plugin_slug;
protected $version;
public function __construct() {
$this->plugin_slug = 'jm-portfolio';
<?php
/*
* Plugin Name: JM Breaking News
* Plugin URI: http://www.jacobmartella.com/jm-breaking-news/
* Description: Displays a breaking news banner, similar to that of CNN, with custom text and link on the webpage via a custom post type.
* Version: 1.8.2
* Author: Jacob Martella
* Author URI: http://www.jacobmartella.com
* License: GPLv3
* Text Domain: jm-breaking-news