  Given an uncountable regular cardinal $\kappa$, a partial order is
$\kappa$-stationarily layered if the collection of regular suborders of
$\mathbb{P}$ of cardinality less than $\kappa$ is stationary in
$\mathcal{P}_\kappa(\mathbb{P})$. We show that weak compactness can be
characterized by this property of partial orders by proving that an uncountable
regular cardinal $\kappa$ is weakly compact if and only if every partial order
satisfying the $\kappa$-chain condition is $\kappa$-stationarily layered. We
prove a similar result for strongly inaccessible cardinals. Moreover, we show
that the statement that all $\kappa$-Knaster partial orders are
$\kappa$-stationarily layered implies that $\kappa$ is a Mahlo cardinal and
every stationary subset of $\kappa$ reflects. This shows that this statement
characterizes weak compactness in canonical inner models. In contrast, we show
that it is also consistent that this statement holds at a non-weakly compact
cardinal.
